Lightweight & optimized Multi-Arch Docker Images (x86_64
/arm
/arm64
) for PHP-FPM (PHP 8.0, 8.1, 8.2) with essential extensions on top of latest Alpine Linux. ๐
v8.0 | v8.1 | v8.2 |
---|---|---|
curl
, ftp
, hash
(mhash
), libedit
, libsodium
, mbstring
, mysqlnd
, openssl
, password-argon2
, pdo-sqlite
, pear
, sqlite3
, zlib
Extension | v8.0 | v8.1 | v8.2 |
---|---|---|---|
amqp | โ | โ | โ |
apcu | โ | โ | โ |
bcmath | โ | โ | โ |
bz2 | โ | โ | โ |
exif | โ | โ | โ |
gd | โ | โ | โ |
gettext | โ | โ | โ |
gmp | โ | โ | โ |
imagick | โ | โ | โ |
imap | โ | โ | โ |
intl | โ | โ | โ |
mcrypt | โ | ? | ? |
memcache | โ | โ | โ |
mongodb | โ | โ | โ |
mysqli | โ | โ | โ |
oauth | โ | โ | โ |
opcache | โ | โ | โ |
pcntl | โ | โ | โ |
pdo_dblib | โ | โ | โ |
pdo_mysql | โ | โ | โ |
pdo_pgsql | โ | โ | โ |
pdo_sqlsrv | โ (64-bit only) | โ (64-bit only) | โ (64-bit only) |
pgsql | โ | โ | โ |
phalcon | ? | โ | โ |
psr | โ | โ | โ |
redis | โ | โ | โ |
rdkafka | โ | โ | โ |
soap | โ | โ | โ |
sockets | โ | โ | โ |
sqlsrv | โ (64-bit only) | โ (64-bit only) | โ (64-bit only) |
ssh2 | โ | โ | โ |
swoole | โ | โ | โ |
sysvmsg | โ | โ | โ |
sysvsem | โ | โ | โ |
sysvshm | โ | โ | โ |
tidy | โ | โ | โ |
vips | โ | โ | โ |
xsl | โ | โ | โ |
yaml | โ | โ | โ |
zip | โ | โ | โ |
ย | ย | ย | ย |
Others | |||
composer | v2.5 | v2.5 | v2.5 |
Footnotes
(?) It means that this extension is obsolete/unmaintained/discourage or simply is not supported yet.
If you want to know the whole list of the included extensions then use php -m
as follow.
docker run --rm joseluisq/php-fpm:8.2 php -m
Or use php -i
to get a more detailed information.
docker pull joseluisq/php-fpm:8.2
# Or
docker pull joseluisq/php-fpm:8.1
# Or
docker pull joseluisq/php-fpm:8.0
๐ณ Available on Docker Hub โ hub.docker.com/r/joseluisq/php-fpm
FROM joseluisq/php-fpm:8.2
# Or
FROM joseluisq/php-fpm:8.1
# Or
FROM joseluisq/php-fpm:8.0
To give a Docker image a quick try, just execute any of those commands and then navigate to localhost:8088
docker run --rm -p 8088:80 joseluisq/php-fpm:8.2 sh -c "echo '<?php phpinfo();' > index.php; php -S [::]:80 -t ."
# Or
docker run --rm -p 8088:80 joseluisq/php-fpm:8.1 sh -c "echo '<?php phpinfo();' > index.php; php -S [::]:80 -t ."
# Or
docker run --rm -p 8088:80 joseluisq/php-fpm:8.0 sh -c "echo '<?php phpinfo();' > index.php; php -S [::]:80 -t ."
- Default Docker working directory:
/var/www/html
- Additional PHP
.ini
files to load:/usr/local/etc/php/conf.d
- Custom PHP
.ini
file generated (only ifENV_SUBSTITUTION_ENABLE=true
):/usr/local/etc/php/conf.d/default-php.ini
PHP-FPM and PHP configurations can be overwritten using environment variables.
To do so, just indicate the substitution of values using ENV_SUBSTITUTION_ENABLE=true
(since it is disabled by default).
Below are the environment variables with their default values:
Settings replaced into /usr/local/etc/php-fpm.conf
file.
PHP_FPM_ERROR_LOG=/proc/self/fd/2
PHP_FPM_LOG_LEVEL=error
Settings replaced into /usr/local/etc/php-fpm.d/www.conf
file.
PHP_FPM_LISTEN=9000
PHP_FPM_USER=www-data
PHP_FPM_GROUP=www-data
PHP_FPM_LISTEN_OWNER=www-data
PHP_FPM_LISTEN_GROUP=www-data
Settings replaced into /usr/local/etc/php/conf.d/default-php.ini
file (php.ini
).
PHP_MEMORY_LIMIT=512M
PHP_EXPOSE_PHP=On
PHP_SESSION_GC_MAXLIFETIME=1440
docker-compose examples for Nginx and Apache servers can be found under the ./examples directory.
docker-compose -f examples/nginx/docker-compose.yml up
docker-compose -f examples/apache/docker-compose.yml up
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.
Feel free to send some pull request or file some issue.
This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
ยฉ 2020-present Jose Quintana