phppdf Docs

A Docker image for running PHP CLI tooling against a project

Source ↗

Docs

Using the CLI

The image has no ENTRYPOINT, so any command can be run directly — composer, php, or any vendor/bin/ script — as long as the project is mounted at /app. It runs as the non-root app user (UID/GID 1000) by default; see running as your user if your host UID differs.

Examples

Install dependencies:

docker run --rm -v ./:/app ghcr.io/phppdf/docker-image-php-cli:dev composer install

Run the test suite:

docker run --rm -v ./:/app ghcr.io/phppdf/docker-image-php-cli:dev vendor/bin/phpunit

Run PHPStan:

docker run --rm -v ./:/app ghcr.io/phppdf/docker-image-php-cli:dev vendor/bin/phpstan analyse

Open a shell in the container:

docker run --rm -it -v ./:/app ghcr.io/phppdf/docker-image-php-cli:dev bash

Print the PHP version:

docker run --rm ghcr.io/phppdf/docker-image-php-cli:dev php -v