PHP CLI Docker image for Symfony development. Published for PHP 8.3, 8.4 and 8.5, on linux/arm64 and linux/amd64 (Docker pulls only the platform matching your machine).
# Latest stable (PHP 8.5)
docker pull ghcr.io/brei0x/php-cli-workspace:latest
# Pin a specific PHP version
docker pull ghcr.io/brei0x/php-cli-workspace:8.3
# Interactive shell
docker run --rm -it ghcr.io/brei0x/php-cli-workspace
# Mount a project
docker run --rm -it -v $(pwd):/app ghcr.io/brei0x/php-cli-workspace php bin/console list- PHP 8.3, 8.4 or 8.5 (Debian Trixie)
- Composer 2
- Xdebug 3 (mode
offby default) - Extensions:
bcmathbz2curlexiffileinfogdintlmbstringopcacheopensslpcntlpdo_mysqlpdo_pgsqlpgsqlsodiumsocketsxslzip
Xdebug is installed but disabled by default to avoid overhead. Enable it at runtime via the XDEBUG_MODE environment variable:
# Step debugging (PHPStorm / any DAP client)
docker run --rm -it -e XDEBUG_MODE=debug -v $(pwd):/app ghcr.io/brei0x/php-cli-workspace php bin/console …
# Profiling
docker run --rm -it -e XDEBUG_MODE=profile -v $(pwd):/app ghcr.io/brei0x/php-cli-workspace php …Default settings: client_host=host.docker.internal, client_port=9003, idekey=PHPSTORM.
The setup is identical in both IDEs — they share the same PHP plugin platform.
- Settings → PHP → CLI Interpreter → + → choose Docker, select
ghcr.io/brei0x/php-cli-workspace. - Set the path mapping:
/app→ your local project root. - In your run/debug configuration, add
XDEBUG_MODE=debugas an environment variable. - Start the debugger listener (port 9003 is the default — no change needed).
If you already have the image pulled, re-pull to get the latest version — Docker only downloads changed layers:
docker pull ghcr.io/brei0x/php-cli-workspace:latestTo verify the image date after pulling:
docker inspect ghcr.io/brei0x/php-cli-workspace:latest --format '{{.Created}}'| Tag | PHP |
|---|---|
latest |
8.5 |
8.5 |
8.5 |
8.4 |
8.4 |
8.3 |
8.3 |
Each tag covers linux/arm64 and linux/amd64. To pull the other platform (for example an amd64 image on Apple Silicon, run under emulation):
docker pull --platform linux/amd64 ghcr.io/brei0x/php-cli-workspace:latestThe Dockerfile itself is versioned by git tags (vX.Y.Z) and GitHub releases, cut from the Conventional Commits of each push to main. Image tags stay by PHP version, and every tag is rebuilt each Monday to pick up PHP and Debian security patches.
# Default (PHP 8.5)
docker build -t php-cli-workspace .
# A specific version
docker build --build-arg PHP_VERSION=8.3 -t php-cli-workspace:8.3 .MIT. The image also ships PHP, Debian packages and Composer under their own licenses.