New generation of php containers. All settings can be adjusted on the fly by ENV variables.
Currently supported Frameworks and Apps:
- Symfony
- Shopware 6
- Open Mage / Magento 1
- Magento 2
Distro | Image |
---|---|
Alpine 3.16 | ambimax/php-8.0-alpine3.16 |
Debian Bullseye | ambimax/php-8.0-bullseye |
Distro | Image |
---|---|
Alpine 3.16 | ambimax/php-8.1-alpine3.16 |
Alpine 3.17 | ambimax/php-8.1-alpine3.17 |
Debian Bullseye | ambimax/php-8.1-bullseye |
Distro | Image |
---|---|
Alpine 3.17 | ambimax/php-8.2-alpine3.17 |
Debian Bullseye | ambimax/php-8.2-bullseye |
Older images can be found on https://hub.docker.com/u/ambimax
PHP Version | Link |
---|---|
8.0 | template/components/php/8.0/assets/all.env |
8.1 | template/components/php/8.1/assets/all.env |
8.2 | template/components/php/8.2/assets/all.env |
Name | End Of Life |
---|---|
PHP 8.0 | 2023-11-26 |
PHP 8.1 | 2024-11-25 |
PHP 8.2 | 2025-12-08 |
Alpine 3.16 | 2024-05-23 |
Alpine 3.17 | 2024-11-22 |
Debian Bullseye | 2024-07-01 |
PHP Module | 8.0 | 8.1 | 8.2 |
---|---|---|---|
apcu | ✓ | ✓ | ✓ |
bcmath | ✓ | ✓ | ✓ |
calendar | ✓ | ✓ | ✓ |
Core | ✓ | ✓ | ✓ |
ctype | ✓ | ✓ | ✓ |
curl | ✓ | ✓ | ✓ |
date | ✓ | ✓ | ✓ |
dom | ✓ | ✓ | ✓ |
exif | ✓ | ✓ | ✓ |
fileinfo | ✓ | ✓ | ✓ |
filter | ✓ | ✓ | ✓ |
ftp | ✓ | ✓ | ✓ |
gd | ✓ | ✓ | ✓ |
gettext | ✓ | ✓ | ✓ |
gmp | ✓ | ✓ | ✓ |
hash | ✓ | ✓ | ✓ |
iconv | ✓ | ✓ | ✓ |
igbinary | ✓ | ✓ | ✓ |
intl | ✓ | ✓ | ✓ |
json | ✓ | ✓ | ✓ |
libxml | ✓ | ✓ | ✓ |
lzf | ✓ | ✓ | ✓ |
mbstring | ✓ | ✓ | ✓ |
memcached | ✓ | ✓ | ✓ |
mysqlnd | ✓ | ✓ | ✓ |
openssl | ✓ | ✓ | ✓ |
pcre | ✓ | ✓ | ✓ |
PDO | ✓ | ✓ | ✓ |
pdo_mysql | ✓ | ✓ | ✓ |
pdo_sqlite | ✓ | ✓ | ✓ |
Phar | ✓ | ✓ | ✓ |
posix | ✓ | ✓ | ✓ |
random | ✓ | ||
readline | ✓ | ✓ | ✓ |
redis | ✓ | ✓ | ✓ |
Reflection | ✓ | ✓ | ✓ |
session | ✓ | ✓ | ✓ |
SimpleXML | ✓ | ✓ | ✓ |
soap | ✓ | ✓ | ✓ |
sockets | ✓ | ✓ | ✓ |
sodium | ✓ | ✓ | ✓ |
SPL | ✓ | ✓ | ✓ |
sqlite3 | ✓ | ✓ | ✓ |
standard | ✓ | ✓ | ✓ |
tokenizer | ✓ | ✓ | ✓ |
xml | ✓ | ✓ | ✓ |
xmlreader | ✓ | ✓ | ✓ |
xmlrpc | ✓ | ✓ | ✓ |
xmlwriter | ✓ | ✓ | ✓ |
xsl | ✓ | ✓ | ✓ |
Zend OPcache | ✓ | ✓ | ✓ |
zip | ✓ | ✓ | ✓ |
zlib | ✓ | ✓ | ✓ |
Show installed version of PHP
docker run --rm ambimax/php-8.1-alpine3.16:latest php -v
Show installed modules of PHP
docker run --rm ambimax/php-8.1-alpine3.16:latest php -m
Mount folder, set env variables and enter
docker run --interactive --tty --rm \
--env PHP_ERROR_REPORTING=-1 \
--env PHP_DISPLAY_ERRORS=Off \
--env "PHP_DATE_TIMEZONE=Europe/Berlin" \
--volume=$PWD:/app \
--workdir /app \
ambimax/php-8.1-alpine3.16:latest bash
Minimal setup (ensure proper nginx configuration!)
version: '3.7'
services:
fpm:
image: 'ambimax/php-8.1-alpine3.16:latest'
volumes:
- '${PWD}/src:/var/www/'
command: ['php-fpm', '-F']
expose:
- 9000
networks:
backend:
nginx:
image: nginx:1.23-alpine
volumes:
- '${PWD}/config/nginx:/etc/nginx/templates'
- '${PWD}/src:/var/www/'
environment:
API_HOST: fpm:9000
ports:
- '8080:80'
networks:
backend:
networks:
backend:
Important: Command command: ['php-fpm', '-F']
must be defined!
Extended setup example:
version: '3.7'
services:
fpm:
image: 'ambimax/php-8.1-alpine3.16:latest'
volumes:
- '${PWD}/src:/var/www/'
environment:
PHP_FPM_LISTEN_PORT: 9002
FCGI_CONNECT: 'localhost:9002'
PHP_OPCACHE_ERROR_LOG: '/var/www/my.log'
PHP_OPCACHE_FAST_SHUTDOWN: 1
PHP_OPCACHE_MAX_WASTED_PERCENTAGE: 10
PHP_OPCACHE_ENABALE_FILE_OVERRIDE: 1
command: ['php-fpm', '-F']
expose:
- 9002
networks:
backend:
nginx:
image: nginx:1.23-alpine
volumes:
- '${PWD}/config/nginx:/etc/nginx/templates'
- '${PWD}/src:/var/www/'
environment:
API_HOST: fpm:9002
TEST: 7.4
ports:
- '8800:80'
networks:
backend:
exporter:
image: hipages/php-fpm_exporter:latest
ports:
- '9253:9253'
environment:
PHP_FPM_SCRAPE_URI: 'tcp://fpm:9002/status'
PHP_FPM_LOG_LEVEL: 'debug'
networks:
backend:
Use igbinary for serialization:
PHP_SESSION_SERIALIZE_HANDLER: igbinary
PHP_IGBINARY_COMPACT_STRINGS: 1
PHP_APC_SERIALIZER: igbinary
- Syntaxhighlighting in nano
- Colored bash prompt (not yet in alpine)
- No cli container
- No /tools
- Removed php modules
- mysqli
- pdo_pgsql
- pgsql
- tidy
Edit template file template/README.md.twig
and run
make generate
If libraries are missing, use composer for installation
composer install
- Add variant to
manifest.json
- Add variant template file to variants/
- Generate defaults
make VERSION=8.1 VARIANT=alpine3.16 copybuild
What happens?
- Build new php variant image (ignoring errors)
- Copy generated files from new image to asset folder
- Rebuild image with generated configuration
Initialized by Tobias Schifftner for Ambimax GmbH