PHP tools for easier docker based development
This is a
simple docker image for running various PHP tools from the CLI / IDE.
Go to your regular directory root of your app and choose what to do
docker run -it --rm -w /app -v $(pwd):/app kingsquare/php-tools:latest /phpunit
docker run -it --rm -w /app -v $(pwd):/app kingsquare/php-tools:latest /phpcs
docker run -it --rm -w /app -v $(pwd):/app kingsquare/php-tools:latest /phpdoc
docker run -it --rm -w /app -v $(pwd):/app kingsquare/php-tools:latest /composer
XDebug is loaded so no need to worry :)
One handy trick is to create a few run commands for even easier use
#!/bin/bash docker run \ -it \ --rm \ -v $(pwd):/app \ -w /app \ kingsquare/php-tools:latest /phpunit $*
for the other tools, you could replace
One of the downsides of this way of using PHP tools is newly added files aren't owned by you. Thats something that leaves
to be desired. You could use the
-u $(id -u) flag for the
docker run command but that way the group of the
newly created files would still be
In order to allow easier switching of the various tools between PHP versions. We've tagged the PHP version as the image tag.
php-tools:latest will use the latest PHP stable, but
php-tools:5.4 will use 5.4 ;)
Please post an issue on the issuetracker!