Skip to content

Repository files navigation

PHP Docker Container Images

Build StatusDocker PullsDocker StarsDocker Layers

Table of Contents

Docker Images

❗For better reliability we release images with stability tags (wodby/php:8.0-X.X.X) which correspond to git tags. We strongly recommend using images only with stability tags.

About images:

Supported tags and respective Dockerfile links:

-dev

Images with -dev tag have a few differences:

  • sudo allowed for all commands for wodby user
  • PHP source code available under /usr/src/php.tar.xz
  • PHP_FPM_CLEAR_ENV is set to no by default
  • Additional packages installed: yarn
  • Blackfire CLI installed

-dev-macos

Same as -dev but the default user/group wodby has uid/gid 501/20 to match the macOS default user/group ids.

Supported architectures

All images built for linux/amd64 and linux/arm64

Environment Variables

PHP and PHP-FPM configuration

The default configuration not recommended for use for production environment:

Variable8.07.47.3
PHP_ALLOW_URL_FOPENOnOnOn
PHP_APCU_ENABLE_CLI000
PHP_APCU_ENABLED111
PHP_APCU_ENTRIES_HINT409640964096
PHP_APCU_COREDUMP_UNMAP000
PHP_APCU_GC_TTL360036003600
PHP_APCU_PRELOAD_PATHNULLNULLNULL
PHP_APCU_SERIALIZER
PHP_APCU_SHM_SEGMENTS111
PHP_APCU_SHM_SIZE32M32M32M
PHP_APCU_SLAM_DEFENSE111
PHP_APCU_TTL000
PHP_APCU_USE_REQUEST_TIME111
PHP_ASSERT_ACTIVEOnOnOn
PHP_AUTO_PREPEND_FILE
PHP_AUTO_APPEND_FILE
PHP_BLACKFIRE
PHP_BLACKFIRE_AGENT_HOSTblackfireblackfireblackfire
PHP_BLACKFIRE_AGENT_PORT870787078707
PHP_CLI_MEMORY_LIMIT-1-1-1
PHP_DATE_TIMEZONEUTCUTCUTC
PHP_DEFAULT_SOCKET_TIMEOUT606060
PHP_DISPLAY_ERRORSOnOnOn
PHP_DISPLAY_STARTUP_ERRORSOnOnOn
PHP_ERROR_REPORTINGE_ALLE_ALLE_ALL
PHP_EXPOSEOffOffOff
PHP_EXTENSIONS_DISABLE
PHP_FPM_CLEAR_ENVyesyesyes
PHP_FPM_ENV_VARS
PHP_FPM_LOG_LEVELnoticenoticenotice
PHP_FPM_PMdynamicdynamicdynamic
PHP_FPM_PM_MAX_CHILDREN888
PHP_FPM_PM_MAX_REQUESTS500500500
PHP_FPM_PM_MAX_SPARE_SERVERS333
PHP_FPM_PM_MIN_SPARE_SERVERS111
PHP_FPM_PM_STATUS_PATH
PHP_FPM_REQUEST_SLOWLOG_TIMEOUT
PHP_FPM_PM_START_SERVERS222
PHP_FPM_USERwww-datawww-datawww-data
PHP_FPM_GROUPwww-datawww-datawww-data
PHP_IGBINARY_COMPACT_STRINGSOnOnOn
PHP_LOG_ERRORSOnOnOn
PHP_LOG_ERRORS_MAX_LEN000
PHP_MAX_EXECUTION_TIME120120120
PHP_MAX_FILE_UPLOADS202020
PHP_MAX_INPUT_TIME606060
PHP_MAX_INPUT_VARS200020002000
PHP_MBSTRING_HTTP_INPUT---
PHP_MBSTRING_HTTP_OUTPUT---
PHP_MBSTRING_ENCODING_TRANSLATION---
PHP_MEMORY_LIMIT512M512M512M
PHP_MYSQL_CACHE_SIZE---
PHP_MYSQLI_CACHE_SIZE200020002000
PHP_NEWRELIC_ENABLED-falsefalse
PHP_NEWRELIC_LICENSE-
see all newrelic ext options-7.x newrelic7.x newrelic
PHP_OPCACHE_ENABLE111
PHP_OPCACHE_ENABLE_CLI000
PHP_OPCACHE_VALIDATE_TIMESTAMPS111
PHP_OPCACHE_REVALIDATE_FREQ222
PHP_OPCACHE_MAX_ACCELERATED_FILES400040004000
PHP_OPCACHE_MEMORY_CONSUMPTION128128128
PHP_OPCACHE_INTERNED_STRINGS_BUFFER888
PHP_OPCACHE_FAST_SHUTDOWN---
PHP_OPCACHE_HUGE_CODE_PAGES000
PHP_OPCACHE_PRELOAD---
PHP_OPCACHE_PRELOAD_USERwww-datawww-datawww-data
PHP_OUTPUT_BUFFERING409640964096
PHP_PCOV_ENABLED000
see all pcov ext options8.x pcov7.x pcov7.x pcov
PHP_PDO_MYSQL_CACHE_SIZE---
PHP_PHAR_READONLY111
PHP_PHAR_REQUIRE_HASH111
PHP_PHAR_CACHE_LIST
PHP_POST_MAX_SIZE32M32M32M
PHP_REALPATH_CACHE_SIZE4096k4096k4096k
PHP_REALPATH_CACHE_TTL120120120
PHP_SENDMAIL_PATH/bin/true/bin/true/bin/true
PHP_SESSION_SAVE_HANDLERfilesfilesfiles
[PHP_SHORT_OPEN_TAG]111
see all sqlsrv ext options-7.x sqlsrv7.x sqlsrv
see all session options8.0 session7.4 session7.3 session
PHP_XHPROF
PHP_TRACK_ERRORS---
PHP_UPLOAD_MAX_FILESIZE32M32M32M
PHP_XDEBUG
PHP_XDEBUG_MODEoffoffoff
see all xdebug ext options8.x xdebug7.x xdebug7.x xdebug
PHP_ZEND_ASSERTIONS111

"-" - Not available for this version

Additional configuration

VariableDefault value
GIT_USER_EMAILwodby@example.com
GIT_USER_NAMEwodby
SSH_PRIVATE_KEY
SSH_DISABLE_STRICT_KEY_CHECKING
SSHD_GATEWAY_PORTSno
SSHD_HOST_KEYS_DIR/etc/ssh
SSHD_LOG_LEVELINFO
SSHD_PASSWORD_AUTHENTICATIONno
SSHD_PERMIT_USER_ENVyes
SSHD_USE_DNSyes

Build arguments

ArgumentDefault value
PHP_VER
PHP_DEV
WODBY_GROUP_ID1000
WODBY_USER_ID1000

Change WODBY_USER_ID and WODBY_GROUP_ID mainly for local dev version of images, if it matches with existing system user/group ids the latter will be deleted.

PHP Extensions

You can disable extension by listing them in $PHP_EXTENSIONS_DISABLE separated by ,, e.g. $PHP_EXTENSIONS_DISABLE=event,ds

Extension8.07.47.3
amqp-1.10.21.10.2
apcu5.1.185.1.185.1.18
ast1.0.101.0.101.0.10
blackfirelatestlatestlatest
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ds1.3.01.3.01.3.0
exif
ereg---
event3.0.43.0.43.0.4
fileinfo
filter
ftp
gd
grpc1.34.01.34.01.34.0
hash
iconv
igbinary3.2.23.2.23.2.2
imagick132a11fd3.4.43.4.4
imap
intl
json
ldap
libxml
mbstring
mcrypt1.0.41.0.41.0.4
memcached3.1.53.1.53.1.5
mongodb1.9.11.9.11.9.1
mysql---
mysqli
mysqlnd
newreliclatestlatestlatest
OAuth2.0.72.0.72.0.7
openssl
pcovlatestlatestlatest
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pdo_sqlsrv5.9.05.9.05.9.0
pgsql
Phar
posix
rdkafka5.0.05.0.05.0.0
readline
redis5.3.45.3.45.3.4
Reflection
session
SimpleXML
soap
sockets
sodium
SPL
sqlite3
sqlsrv5.9.05.9.05.9.0
standard
tideways_xhprof5.0.45.0.45.0.4
tidy
tokenizer
uploadprogress-1.1.31.1.3
uuid1.1.01.1.01.1.0
xdebug3.0.43.0.43.0.4
xml
xmlreader
xmlrpc-
xmlwriter
xsl
yaml2.2.12.2.12.2.1
Zend OPcache
zip
zlib

Legend:

  • [EMPTY] – Core PHP extension
  • "-" - Not exists in this version Some extensions may not be available in -dev images

Extensions xdebug, blackfire and xhprof disabled by default.

Tools

Tool8.07.47.3
Composerlatestlatestlatest

Changelog

Changes per stability tag reflected in git tags description under releases.

Crond

You can run Crond with this image changing the command to sudo -E LD_PRELOAD=/usr/lib/preloadable_libiconv.so crond -f -d 0 and mounting a crontab file to ./crontab:/etc/crontabs/www-data. Example crontab file contents:

# min	hour	day	month	weekday	command
*/1	*	*	*	*	echo "test" > /mnt/files/cron

SSHD

You can run SSHD with this image by changing the command to sudo /usr/sbin/sshd -De and mounting authorized public keys to /home/wodby/.ssh/authorized_keys

Adding SSH key

You can add a private SSH key to the container by mounting it to /home/wodby/.ssh/id_rsa

Users and permissions

Default container user is wodby:wodby (UID/GID 1000). PHP-FPM runs from www-data:www-data user (UID/GID 82) by default. User wodby is a part of www-data group.

Codebase volume $APP_ROOT (/var/www/html) owned by wodby:wodby. Files volume $FILES_DIR (/mnt/files) owned by www-data:www-data with 775 mode.

See wodby#22 for more details.

Helper scripts

  • files_chmod – in case you need write access for wodby user to a file/dir generated by www-data on this volume run sudo files_chmod [FILEPATH] script (FILEPATH must be under /mnt/files), it will recursively change the mode to ug=rwX,o=rX

  • files_chown – in case you manually uploaded files under wodby user to files volume and want to change the ownership of those files to www-data run sudo files_chown [FILEPATH] script (FILEPATH must be under /mnt/files), it will recursively change ownership to www-data:www-data

Complete PHP-based stacks

Images based on wodby/php

Orchestration Actions

Usage:

make COMMAND [params ...]
commands:
migrate
check-ready [host max_try wait_seconds delay_seconds]
git-clone url [branch]
git-checkout target [is_hash] files-import source
files-link public_dir update-keys
walter
default params values:
is_hash 0
branch "" Branch, tag or hash commit

About

Generic PHP docker container images

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages