Skip to content

Development and Production-ready PHP Alpine Images for Docker with Multi-Architecture support

License

Notifications You must be signed in to change notification settings

ghostwriter/php

Repository files navigation

PHP for Docker Docker CI/CD

Development and Production-ready PHP Images for Docker

Special thanks to @mlocati for creating the fantastic mlocati/docker-php-extension-installer tool, which made all of this possible!

Supported versions: 8.4-rc, 8.3, 8.2, 8.1, 8.0, 7.4, 7.3

PHP 8.4-rc

Code Use PHP 8.4-rc image in Dockerfile

FROM ghcr.io/ghostwriter/php:8.4-rc # 8.4-rc-cli with additional development tools
FROM ghcr.io/ghostwriter/php:8.4-rc-cli
FROM ghcr.io/ghostwriter/php:8.4-rc-fpm
FROM ghcr.io/ghostwriter/php:8.4-rc-zts

Terminal Pull & Run PHP 8.4-rc image from the command line

docker pull ghcr.io/ghostwriter/php:8.4-rc
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4-rc vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.4-rc-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4-rc-cli vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.4-rc-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4-rc-fpm vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.4-rc-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4-rc-zts vendor/bin/phpunit

PHP 8.3

Code Use PHP 8.3 image in Dockerfile

FROM ghcr.io/ghostwriter/php:8.3 # 8.3-cli with additional development tools
FROM ghcr.io/ghostwriter/php:8.3-cli
FROM ghcr.io/ghostwriter/php:8.3-fpm
FROM ghcr.io/ghostwriter/php:8.3-zts

Terminal Pull & Run PHP 8.3 image from the command line

docker pull ghcr.io/ghostwriter/php:8.3
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.3 vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.3-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.3-cli vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.3-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.3-fpm vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.3-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.3-zts vendor/bin/phpunit

PHP 8.2

Code Use PHP 8.2 image in Dockerfile

FROM ghcr.io/ghostwriter/php:8.2 # 8.2-cli with additional development tools
FROM ghcr.io/ghostwriter/php:8.2-cli
FROM ghcr.io/ghostwriter/php:8.2-fpm
FROM ghcr.io/ghostwriter/php:8.2-zts

Terminal Pull & Run PHP 8.2 image from the command line

docker pull ghcr.io/ghostwriter/php:8.2
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.2 vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.2-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.2-cli vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.2-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.2-fpm vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.2-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.2-zts vendor/bin/phpunit

PHP 8.1

Code Use PHP 8.1 image in Dockerfile

FROM ghcr.io/ghostwriter/php:8.1 # 8.1-cli with additional development tools
FROM ghcr.io/ghostwriter/php:8.1-cli
FROM ghcr.io/ghostwriter/php:8.1-fpm
FROM ghcr.io/ghostwriter/php:8.1-zts

Terminal Pull & Run PHP 8.1 image from the command line

docker pull ghcr.io/ghostwriter/php:8.1
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.1 vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.1-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.1-cli vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.1-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.1-fpm vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.1-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.1-zts vendor/bin/phpunit

PHP 8.0

Code Use PHP 8.0 image in Dockerfile

FROM ghcr.io/ghostwriter/php:8.0 # 8.0-cli with additional development tools
FROM ghcr.io/ghostwriter/php:8.0-cli
FROM ghcr.io/ghostwriter/php:8.0-fpm
FROM ghcr.io/ghostwriter/php:8.0-zts

Terminal Pull & Run PHP 8.0 image from the command line

docker pull ghcr.io/ghostwriter/php:8.0
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.0 vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.0-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.0-cli vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.0-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.0-fpm vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:8.0-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.0-zts vendor/bin/phpunit

PHP 7.4

Code Use PHP 7.4 image in Dockerfile

FROM ghcr.io/ghostwriter/php:7.4 # 7.4-cli with additional development tools
FROM ghcr.io/ghostwriter/php:7.4-cli
FROM ghcr.io/ghostwriter/php:7.4-fpm
FROM ghcr.io/ghostwriter/php:7.4-zts

Terminal Pull & Run PHP 7.4 image from the command line

docker pull ghcr.io/ghostwriter/php:7.4
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.4 vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:7.4-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.4-cli vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:7.4-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.4-fpm vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:7.4-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.4-zts vendor/bin/phpunit

PHP 7.3

Code Use PHP 7.3 image in Dockerfile

FROM ghcr.io/ghostwriter/php:7.3 # 7.3-cli with additional development tools
FROM ghcr.io/ghostwriter/php:7.3-cli
FROM ghcr.io/ghostwriter/php:7.3-fpm
FROM ghcr.io/ghostwriter/php:7.3-zts

Terminal Pull & Run PHP 7.3 image from the command line

docker pull ghcr.io/ghostwriter/php:7.3
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.3 vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:7.3-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.3-cli vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:7.3-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.3-fpm vendor/bin/phpunit
docker pull ghcr.io/ghostwriter/php:7.3-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:7.3-zts vendor/bin/phpunit