Skip to content

Latest commit

 

History

History
183 lines (160 loc) · 4.81 KB

README.md

File metadata and controls

183 lines (160 loc) · 4.81 KB

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, 8.3, 8.2, 8.1

PHP 8.4

Code Use PHP 8.4 image in Dockerfile

CLI with code coverage

FROM ghcr.io/ghostwriter/php:8.4

CLI

FROM ghcr.io/ghostwriter/php:8.4-cli

FPM

FROM ghcr.io/ghostwriter/php:8.4-fpm

ZTS

FROM ghcr.io/ghostwriter/php:8.4-zts

Terminal Pull & Run PHP 8.4 image from the command line

CLI with code coverage

docker pull ghcr.io/ghostwriter/php:8.4
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4 php -v

CLI

docker pull ghcr.io/ghostwriter/php:8.4-cli
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4-cli php -v

FPM

docker pull ghcr.io/ghostwriter/php:8.4-fpm
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4-fpm php -v

ZTS

docker pull ghcr.io/ghostwriter/php:8.4-zts
docker run -it --rm -v $PWD:/opt/app -w /opt/app ghcr.io/ghostwriter/php:8.4-zts php -v

PHP 8.3

Code Use PHP 8.3 image in Dockerfile

CLI with code coverage

FROM ghcr.io/ghostwriter/php:8.3

CLI

FROM ghcr.io/ghostwriter/php:8.3-cli

FPM

FROM ghcr.io/ghostwriter/php:8.3-fpm

ZTS

FROM ghcr.io/ghostwriter/php:8.3-zts

Terminal Pull & Run PHP 8.3 image from the command line

CLI with code coverage

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 php -v

CLI

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 php -v

FPM

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 php -v

ZTS

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 php -v

PHP 8.2

Code Use PHP 8.2 image in Dockerfile

CLI with code coverage

FROM ghcr.io/ghostwriter/php:8.2

CLI

FROM ghcr.io/ghostwriter/php:8.2-cli

FPM

FROM ghcr.io/ghostwriter/php:8.2-fpm

ZTS

FROM ghcr.io/ghostwriter/php:8.2-zts

Terminal Pull & Run PHP 8.2 image from the command line

CLI with code coverage

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 php -v

CLI

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 php -v

FPM

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 php -v

ZTS

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 php -v

PHP 8.1

Code Use PHP 8.1 image in Dockerfile

CLI with code coverage

FROM ghcr.io/ghostwriter/php:8.1

CLI

FROM ghcr.io/ghostwriter/php:8.1-cli

FPM

FROM ghcr.io/ghostwriter/php:8.1-fpm

ZTS

FROM ghcr.io/ghostwriter/php:8.1-zts

Terminal Pull & Run PHP 8.1 image from the command line

CLI with code coverage

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 php -v

CLI

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 php -v

FPM

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 php -v

ZTS

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 php -v