wp-cli command line docker image
10K+
The Braz PHP Docker project provides a set of Docker images tailored for various PHP environments and use cases.
It simplifies the process of setting up PHP development environments by offering pre-configured images for different frameworks and tools, such as Vanilla PHP, Composer, Symfony, WP-CLI, and Phalcon.
These images support multiple PHP versions and architectures, ensuring compatibility and flexibility for developers.
We also provide an AI generated DeepWiki Pageā with more technical information.
š” For a complete list of available images, please visit the PHP System Docsā page.
To use the images, you can pull them from Docker Hub and run them with your PHP scripts or commands. Here are some examples of how to use the images:
| Docker Image | Entrypoint | Command Example | Build Status |
|---|---|---|---|
| php-cliā | /usr/bin/php | docker run -v $pwd:/workspace --rm fbraz3/php-cli:8.4 myscript.php | |
| phalconā | /usr/bin/php | docker run -v $pwd:/workspace --rm fbraz3/php-cli:8.4-phalcon myscript.php | |
| php-composerā | /usr/local/bin/composer | docker run -v $pwd:/workspace --rm fbraz3/php-composer:8.4 init | |
| wp-cliā | /usr/local/bin/wp | docker run -v $pwd:/workspace --rm fbraz3/wp-cli:8.4 plugin install bbpress | |
| symfony-cliā | /usr/local/bin/symfony | docker run -v $pwd:/workspace --rm fbraz3/symfony-cli:8.4 server:start |
Each image is tagged with the PHP version. For example:
fbraz3/php-cli:8.4 for PHP 8.4fbraz3/php-cli:8.4-phalcon for PHP 8.4 with Phalcon extensionfbraz3/php-composer:8.4 for PHP 8.4 with Composerfbraz3/symfony-cli:8.4 for PHP 8.4 with Symfony CLIfbraz3/wp-cli:8.4 for PHP 8.4 with WP-CLIThis project includes the following flavors:
Each flavor supports multiple PHP versions, ranging from 5.6 to 8.4, and is available for both amd64 and arm64 architectures.
The images are designed to run as the php user by default (uid 1000). If you need to run commands as the root user, you can use the --user flag when running the container.
If you need to write to a mounted volume, ensure that the php user has the necessary permissions. You can set the ownership of the mounted directory to the php user by running:
chown -R 1000:1000 /path/to/your/directory
A workaround for this is to chmod the mounted directory to 777 before running the container. This will allow all users to read, write, and execute files in that directory. However, this is not recommended for production environments due to security concerns.
There is another workaround for this running the container with the --user flag set to root, but this is also not recommended for production environments.
The default directory for the container is /workspace, but you can change it by setting the WORKDIR environment variable in your Dockerfile or when running the container.
All images have ssmtp pre-installed and configured to send emails. The default SMTP server is localhost on port 25. You can use the mail() function in PHP to send emails from the container.
It's recommended to change the default SMTP server to your own SMTP server. You can do this by setting the SMTP environment variable when running the container. For example:
docker run -v $pwd:/workspace -e SMTP_MAIL_SERVER=smtp.example.com -e SMTP_AUTH_USER=username -e SMTP_AUTH_PASSWORD=password --rm fbraz3/php-cli:8.4 mail_sending.php
ā¼ļøNote: avoid setting the password in the command line, use a .env file instead.
For example, create a .env file with the following content:
SMTP_MAIL_SERVER=smtp.example.com
SMTP_AUTH_USER=username
SMTP_AUTH_PASSWORD=password
Then run the container with the --env-file option:
docker run -v $pwd:/workspace --env-file .env --rm fbraz3/php-cli:8.4 mail_sending.php
To validate all environment variables you can use for mail sending, please check the file ssmtp.shā .
Is also recommended to refer to ssmtp documentationā for more information about its configuration.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.
Please visit the CONTRIBUTING.mdā file for guidelines on how to contribute to this project.
I spend a lot of time and effort maintaining this project. If you find it useful, consider supporting me with a donation:
This project is licensed under the Apache License 2.0ā , so you can use it for personal and commercial projects. However, please note that the images are provided "as is" without any warranty or guarantee of any kind. Use them at your own risk.
Content type
Image
Digest
sha256:33ad79124ā¦
Size
219.1 MB
Last updated
5 days ago
docker pull fbraz3/wp-cli:7.4