• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generic PHP docker container images

PHP Docker Container Images

Build Status Docker Pulls Docker Stars

Table of Contents

Docker Images

❗For better reliability we release images with stability tags (wodby/php:8-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

-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:

Variable 8.2 8.1 8.0
PHP_ALLOW_URL_FOPEN On On On
PHP_APCU_ENABLE_CLI 0 0 0
PHP_APCU_ENABLED 1 1 1
PHP_APCU_ENTRIES_HINT 4096 4096 4096
PHP_APCU_COREDUMP_UNMAP 0 0 0
PHP_APCU_GC_TTL 3600 3600 3600
PHP_APCU_PRELOAD_PATH NULL NULL NULL
PHP_APCU_SERIALIZER
PHP_APCU_SHM_SEGMENTS 1 1 1
PHP_APCU_SHM_SIZE 32M 32M 32M
PHP_APCU_SLAM_DEFENSE 1 1 1
PHP_APCU_TTL 0 0 0
PHP_APCU_USE_REQUEST_TIME 1 1 1
PHP_ASSERT_ACTIVE On On On
PHP_AUTO_PREPEND_FILE
PHP_AUTO_APPEND_FILE
PHP_BROTLI_OUTPUT_COMPRESSION 0 0 0
PHP_BROTLI_OUTPUT_COMPRESSION_LEVEL -1 -1 -1
PHP_CLI_MEMORY_LIMIT -1 -1 -1
PHP_DATE_TIMEZONE UTC UTC UTC
PHP_DEFAULT_SOCKET_TIMEOUT 60 60 60
PHP_DISPLAY_ERRORS On On On
PHP_DISPLAY_STARTUP_ERRORS On On On
PHP_ERROR_REPORTING E_ALL E_ALL E_ALL
PHP_EXPOSE Off Off Off
PHP_EXTENSIONS_DISABLE
PHP_FPM_CLEAR_ENV yes yes yes
PHP_FPM_ENV_VARS
PHP_FPM_LOG_LEVEL notice notice notice
PHP_FPM_PM dynamic dynamic dynamic
PHP_FPM_PM_MAX_CHILDREN 8 8 8
PHP_FPM_PM_MAX_REQUESTS 500 500 500
PHP_FPM_PM_MAX_SPARE_SERVERS 3 3 3
PHP_FPM_PM_MIN_SPARE_SERVERS 1 1 1
PHP_FPM_PM_STATUS_PATH
PHP_FPM_REQUEST_SLOWLOG_TIMEOUT
PHP_FPM_PM_START_SERVERS 2 2 2
PHP_FPM_USER www-data www-data www-data
PHP_FPM_GROUP www-data www-data www-data
PHP_IGBINARY_COMPACT_STRINGS On On On
PHP_LOG_ERRORS On On On
PHP_LOG_ERRORS_MAX_LEN 0 0 0
PHP_MAX_EXECUTION_TIME 120 120 120
PHP_MAX_FILE_UPLOADS 20 20 20
PHP_MAX_INPUT_TIME 60 60 60
PHP_MAX_INPUT_VARS 2000 2000 2000
PHP_MEMORY_LIMIT 512M 512M 512M
PHP_MYSQLI_CACHE_SIZE 2000 2000 2000
PHP_NEWRELIC_ENABLED false false false
PHP_NEWRELIC_LICENSE
see all newrelic ext options 8.x newrelic 8.x newrelic 8.x newrelic
PHP_OPCACHE_ENABLE 1 1 1
PHP_OPCACHE_ENABLE_CLI 0 0 0
PHP_OPCACHE_VALIDATE_TIMESTAMPS 1 1 1
PHP_OPCACHE_REVALIDATE_FREQ 2 2 2
PHP_OPCACHE_MAX_ACCELERATED_FILES 4000 4000 4000
PHP_OPCACHE_MEMORY_CONSUMPTION 128 128 128
PHP_OPCACHE_INTERNED_STRINGS_BUFFER 8 8 8
PHP_OPCACHE_FAST_SHUTDOWN - - -
PHP_OPCACHE_HUGE_CODE_PAGES 0 0 0
PHP_OPCACHE_PRELOAD - - -
PHP_OPCACHE_PRELOAD_USER www-data www-data www-data
PHP_OPCACHE_JIT tracing tracing tracing
PHP_OPCACHE_JIT_BUFFER_SIZE 0 0 0
PHP_OUTPUT_BUFFERING 4096 4096 4096
PHP_PCOV_ENABLED 0 0 0
see all pcov ext options 8.x pcov 8.x pcov 8.x pcov
PHP_PDO_MYSQL_CACHE_SIZE - - -
PHP_PHAR_READONLY 1 1 1
PHP_PHAR_REQUIRE_HASH 1 1 1
PHP_PHAR_CACHE_LIST
PHP_POST_MAX_SIZE 32M 32M 32M
PHP_REALPATH_CACHE_SIZE 4096k 4096k 4096k
PHP_REALPATH_CACHE_TTL 120 120 120
PHP_SENDMAIL_PATH /bin/true /bin/true /bin/true
PHP_MAIL_MIXED_LF_AND_CRLF - - Off
PHP_SESSION_SAVE_HANDLER files files files
PHP_SHORT_OPEN_TAG 1 1 1
see all sqlsrv ext options - - -
see all session options 8.2 session 8.1 session 8.0 session
PHP_XHPROF
see all xhprof options 8.x xhprof 8.x xhprof 8.x xhprof
PHP_UPLOAD_MAX_FILESIZE 32M 32M 32M
PHP_XDEBUG
PHP_XDEBUG_MODE off off off
see all xdebug ext options 8.x xdebug 8.x xdebug 8.x xdebug
PHP_ZEND_ASSERTIONS 1 1 1

"-" - Not available for this version

Additional configuration

Variable Default value
GIT_USER_EMAIL [email protected]
GIT_USER_NAME wodby
HTTP_PROXY
SSH_PRIVATE_KEY
SSH_DISABLE_STRICT_KEY_CHECKING
SSHD_GATEWAY_PORTS no
SSHD_HOST_KEYS_DIR /etc/ssh
SSHD_LOG_LEVEL INFO
SSHD_PASSWORD_AUTHENTICATION no
SSHD_PERMIT_USER_ENV yes
SSHD_USE_DNS yes
SSMTP_MAILHUB opensmtpd:25
SSMTP_FROM_LINE_OVERRIDE Yes
SSMTP_USE_TLS No

Build arguments

Argument Default value
PHP_VER
PHP_DEV
WODBY_GROUP_ID 1000
WODBY_USER_ID 1000

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

Extension 8.2 8.1 8.0
amqp 1.11.0 1.11.0 1.11.0
apcu 5.1.22 5.1.22 5.1.22
ast 1.1.0 1.1.0 1.1.0
bcmath
brotli 0.13.1 0.13.1 0.13.1
bz2
calendar
Core
ctype
curl
date
dom
ds 1.4.0 1.4.0 1.4.0
exif
event 3.0.8 3.0.8 3.0.8
fileinfo
filter
ftp
gd
hash
iconv
igbinary 3.2.14 3.2.14 3.2.14
imagick 3.7.0 3.7.0 3.7.0
imap
intl
json
ldap
libxml
mbstring
mcrypt - - 1.0.4
memcached 3.2.0 3.2.0 3.2.0
mongodb 1.15.1 1.15.1 1.13.1
mysqli
mysqlnd
newrelic latest latest latest
OAuth 2.0.7 2.0.7 2.0.7
openssl
pcov latest latest latest
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pdo_sqlsrv* 5.11.0 5.11.0 5.11.0
pgsql
Phar
posix
rdkafka 6.0.3 6.0.3 6.0.1
readline
redis 5.3.7 5.3.7 5.3.7
Reflection
session
SimpleXML
smbclient 1.0.6 1.0.6 1.0.6
soap
sockets
sodium
SPL
sqlite3
sqlsrv* 5.11.0 5.11.0 5.11.0
standard
tidy
tokenizer
uploadprogress 2.0.2 2.0.2 2.0.2
uuid 1.2.0 1.2.0 1.2.0
xdebug 3.2.0 3.2.0 3.2.0
xhprof 2.3.9 2.3.9 2.3.9
xml
xmlreader
xmlwriter
xsl
yaml 2.2.3 2.2.3 2.2.3
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 and xhprof disabled by default.

  • sqlsrv extension has no arm64 support because the driver has no support for linux/arm64

Tools

Tool 8.2 8.1 8.0
Composer latest latest latest

Xdebug

By default, xdebug extension not loaded to avoid any performance impact. Set PHP_XDEBUG env var to any value to load it and set PHP_XDEBUG_MODE to the appropriate value (by default off – disabled) to enable xdebug.

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 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 #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

More Repositories

1

docker4drupal

Docker-based Drupal stack
Shell
1,210
star
2

docker4wordpress

Docker-based WordPress stack
Makefile
709
star
3

docker4php

Docker-based PHP stack
Makefile
264
star
4

wordpress-composer

Composer template for WordPress projects.
68
star
5

nginx

Nginx docker container image
Shell
63
star
6

varnish

Varnish docker container image
Shell
59
star
7

drupal-php

PHP docker container image for Drupal
Shell
59
star
8

docker4python

Docker-based Python web stack (works for Django)
Makefile
53
star
9

mariadb

MariaDB docker container image
Shell
48
star
10

docker4ruby

Docker-based Ruby stack (works for Rails)
Makefile
31
star
11

wordpress-php

PHP docker container image for WordPress
Shell
26
star
12

gotpl

Lightweight go-based template engine
Go
23
star
13

adminer

Adminer docker container image
PHP
22
star
14

drupal-nginx

ARCHIVED: merged to https://github.com/wodby/nginx
Smarty
20
star
15

drupal

Vanilla Drupal docker container image
Makefile
18
star
16

wordpress-nginx

ARCHIVED: merged to https://github.com/wodby/nginx
Smarty
17
star
17

opensmtpd

OpenSMTPD docker container image
Makefile
11
star
18

wordpress-varnish

ARCHIVED: merged to https://github.com/wodby/varnish
Smarty
11
star
19

solr

Solr docker container image
Shell
9
star
20

xhprof

Xhprof traces viewer
Makefile
8
star
21

wodby-ci

Wodby CI/CD
Shell
7
star
22

elasticsearch

Elasticsearch docker container image
Shell
7
star
23

wordpress

Vanilla WordPress docker container image
Shell
7
star
24

alpine

Alpine Linux docker container image
Shell
7
star
25

apache

Apache HTTP server docker container image
Shell
6
star
26

node

Node docker container image
Makefile
6
star
27

backup

Simple files backup with upload to s3 container image
Shell
5
star
28

webgrind

Webgrind docker container image
Smarty
5
star
29

drupal-varnish

ARCHIVED: merged to https://github.com/wodby/varnish
Smarty
4
star
30

sshd

Makefile
4
star
31

redis

Redis docker container image
Makefile
4
star
32

cachet

Cachet docker container image
Shell
4
star
33

matomo

Matomo docker container image
Dockerfile
3
star
34

gitlab-runner

Gitlab runner docker container image
Makefile
3
star
35

php-nginx

ARCHIVED: merged to https://github.com/wodby/nginx
Smarty
3
star
36

php-apache

ARCHIVED: merged to https://github.com/wodby/apache
Smarty
3
star
37

wodby-sdk-php

Wodby PHP SDK
PHP
3
star
38

drupal-node

Node.js docker container image for Drupal
Smarty
3
star
39

postgres

PostgreSQL docker container image
Shell
3
star
40

docker4laravel

Docker-based Laravel stack
Makefile
3
star
41

docker-registry-auth

Authentication server for Docker Registry
Shell
3
star
42

jenkins

Jenkins docker image
Groovy
3
star
43

rsyslog

rsyslog docker container image
Makefile
3
star
44

docs

Docs for Wodby platform, stacks and docker4x projects
HTML
2
star
45

images

Docker images auto updater
Shell
2
star
46

python

Python docker container images
Shell
2
star
47

ruby

Ruby docker container image
Shell
2
star
48

jira

JIRA Software docker container image
Smarty
2
star
49

gitlab

GitLab CE docker container image
Smarty
2
star
50

php-docs

ARCHIVED, merged to https://github.com/wodby/docs
HTML
1
star
51

slackin

Slackin docker container image
Makefile
1
star
52

wodby-cli

Wodby CLI
Go
1
star
53

wordpress-docs

DEPRECATED, merged to https://github.com/wodby/docs
HTML
1
star
54

drupal-solr

ARCHIVED: merged to https://github.com/wodby/solr
Shell
1
star
55

nginx-alpine-psol

PSOL objects for alpine-based ngxpagespeed module
Dockerfile
1
star
56

fluentd

Smarty
1
star
57

kibana

Kibana docker container image
Shell
1
star
58

edge-alpine

Deprecated
Dockerfile
1
star