This repository serves as an easy way to configure and build docker PHP images (powered by docker-php-extension-installer) with some extra libraries and tools:
locales: install extra locales with locale-gen to support internal PHP date localization
mhsendmail for local email debugging with mailhog (installed but disabled by default, , can be enabled with ini configuration (cli argument or mounted .ini file)
wkhtmltopdf wkhtmltoimage for html to pdf/image conversion
nodejs / yarn (added at stage2, see below)
chromium, symfony server, global node packages, ... (at stage3, see below)
xdebug is installed but disabled by default, can be enabled with ini configuration (cli argument or mounted .ini file)
All tags are built weekly (on Thursday) based on the official php major.minor php tags (e.g. php:7.4-fpm). The following defaults are applied to these builds:
# get version
docker run -it nlzet/php:8.2-cli php -v
# list configured modules
docker run -it nlzet/php:8.2-cli php -m
# list configured ini files
docker run -it nlzet/php:8.2-cli php --ini
Enable Xdebug:
# command line argument
docker run -it nlzet/php:8.2-cli php -d zend_extension=xdebug.so -v
# or with a mounted .ini file, containing "zend_extension=xdebug.so"
docker run -v $(pwd)/xdebug.ini:/usr/local/etc/php/conf.d/99-enable-xdebug.ini -it nlzet/php:8.2-cli php -v
FPM:
# start fpm container, wich will directly start php-fpm
docker run -it nlzet/php:8.2-fpm
Docker pull all:
versions=(8.0 8.1 8.2)
tags=(ci fpm cli)
for version in $versions
do
for tag in $tags
do
echo "pulling nlzet/php:$version-$tag"
docker pull nlzet/php:$version-$tag
done
done
Check composer / php versions
versions=(8.0 8.1 8.2)
tags=(ci fpm cli)
for version in $versions
do
for tag in $tags
do
echo "checking versions for nlzet/php:$version-$tag"
cmd='$(php -v | head -n 1) - $(composer --version)'
docker run -it nlzet/php:$version-$tag bash -c "echo $(echo $cmd)"
done
done