diff --git a/README.md b/README.md index fb0f611..301c44c 100644 --- a/README.md +++ b/README.md @@ -9,181 +9,47 @@ [![License](https://img.shields.io/badge/license-MIT-%233DA639.svg)](https://opensource.org/licenses/MIT) +| Upstream Project | +|------------------| +| | + +[![](https://img.shields.io/docker/pulls/devilbox/php-fpm.svg)](https://hub.docker.com/r/devilbox/php-fpm) + **Available Architectures:** `amd64`, `arm64` + This repository will provide you fully functional PHP-FPM Docker images in different flavours, -versions and packed with different types of integrated PHP modules. It also solves the problem of **[syncronizing file permissions](#unsynchronized-permissions)** of mounted volumes between the host and the container. +versions and packed with different types of integrated PHP modules. It also solves the problem of **[syncronizing file permissions](doc/syncronize-file-permissions.md)** of mounted volumes between the host and the container. -| Docker Hub | Upstream Project | -|------------|------------------| -| | | - -#### Base Images - -Have a look at the following Devilbox base images for which no official versions exist yet, but are required to serve as a foundation for this repository: - -* [PHP-FPM 5.2](https://github.com/devilbox/docker-php-fpm-5.2) -* [PHP-FPM 5.3](https://github.com/devilbox/docker-php-fpm-5.3) -* [PHP-FPM 7.4](https://github.com/devilbox/docker-php-fpm-7.4) -* [PHP-FPM 8.0](https://github.com/devilbox/docker-php-fpm-8.0) -* [PHP-FPM 8.1](https://github.com/devilbox/docker-php-fpm-8.1) -* [PHP-FPM 8.2](https://github.com/devilbox/docker-php-fpm-8.2) - -#### Documentation - -In case you seek help, go and visit the community pages. - - - - - - - - - - - - - - - - - - - - - -

Documentation

Chat

Forum

- - - - - - - - - - - -
devilbox.readthedocs.iogitter.im/devilboxdevilbox.discourse.group
+:information_source: For detauls see **[Documentation: Syncronize File Permissions](doc/syncronize-file-permissions.md)** -#### Table of Contents +

Docker Tags

-1. **[Motivation](#motivation)** - 1. [Unsynchronized permissions](#unsynchronized-permissions) - 2. [It gets even worse](#it-gets-even-worse) - 3. [The solution](#the-solution) -2. **[PHP-FPM Flavours](#php-fpm-flavours)** - 1. [Assembly](#assembly) - 2. [Available Images](#available-images) - 3. [Tagging](#tagging) - 4. [PHP Modules](#php-modules) -3. **[PHP-FPM Features](#php-fpm-features)** - 1. [Image: base](#image-base) - 2. [Image: mods](#image-mods) - 3. [Image: prod](#image-prod) - 4. [Image: work](#image-work) -4. **[PHP-FPM Options](#php-fpm-options)** - 1. [Environment variables](#environment-variables) - 2. [Volumes](#volumes) - 3. [Ports](#ports) -5. **[PHP Default Configuration](#php-default-configuration)** -6. **[Integrated Development Environment](#integrated-development-environment)** - 1. [What toos can you expect](#what-tools-can-you-expect) - 2. [What else is available](#what-else-is-available) -7. **[Examples](#examples)** - 1. [Provide PHP-FPM port to host](#provide-php-fpm-port-to-host) - 2. [Alter PHP-FPM and system timezone](#alter-php-fpm-and-system-timezone) - 3. [Load custom PHP configuration](#load-custom-php-configuration) - 4. [Load custom PHP modules](#load-custom-php-modules) - 5. [MySQL connect via 127.0.0.1 (via port-forward)](#mysql-connect-via-127-0-0-1-via-port-forward-) - 6. [MySQL and Redis connect via 127.0.0.1 (via port-forward)](#mysql-and-redis-connect-via-127-0-0-1-via-port-forward-) - 7. [Launch Postfix for mail-catching](#launch-postfix-for-mail-catching) - 8. [Webserver and PHP-FPM](#webserver-and-php-fpm) - 9. [Create MySQL Backups](#create-mysql-backups) -8. **[Automated builds](#automated-builds)** -9. **[Contributing](#contributing)** -10. **[Credits](#credits)** -11. **[License](#license)** +* [`5.2-base`](Dockerfiles/base/Dockerfile-5.2), [`5.3-base`](Dockerfiles/base/Dockerfile-5.3), [`5.4-base`](Dockerfiles/base/Dockerfile-5.4), [`5.5-base`](Dockerfiles/base/Dockerfile-5.5), [`5.6-base`](Dockerfiles/base/Dockerfile-5.6), [`7.0-base`](Dockerfiles/base/Dockerfile-7.0), [`7.1-base`](Dockerfiles/base/Dockerfile-7.1), [`7.2-base`](Dockerfiles/base/Dockerfile-7.2), [`7.3-base`](Dockerfiles/base/Dockerfile-7.3), [`7.4-base`](Dockerfiles/base/Dockerfile-7.4), [`8.0-base`](Dockerfiles/base/Dockerfile-8.0), [`8.1-base`](Dockerfiles/base/Dockerfile-8.1), [`8.2-base`](Dockerfiles/base/Dockerfile-8.2) +* [`5.2-mods`](Dockerfiles/mods/Dockerfile-5.2), [`5.3-mods`](Dockerfiles/mods/Dockerfile-5.3), [`5.4-mods`](Dockerfiles/mods/Dockerfile-5.4), [`5.5-mods`](Dockerfiles/mods/Dockerfile-5.5), [`5.6-mods`](Dockerfiles/mods/Dockerfile-5.6), [`7.0-mods`](Dockerfiles/mods/Dockerfile-7.0), [`7.1-mods`](Dockerfiles/mods/Dockerfile-7.1), [`7.2-mods`](Dockerfiles/mods/Dockerfile-7.2), [`7.3-mods`](Dockerfiles/mods/Dockerfile-7.3), [`7.4-mods`](Dockerfiles/mods/Dockerfile-7.4), [`8.0-mods`](Dockerfiles/mods/Dockerfile-8.0), [`8.1-mods`](Dockerfiles/mods/Dockerfile-8.1), [`8.2-mods`](Dockerfiles/mods/Dockerfile-8.2) +* [`5.2-prod`](Dockerfiles/prod/Dockerfile-5.2), [`5.3-prod`](Dockerfiles/prod/Dockerfile-5.3), [`5.4-prod`](Dockerfiles/prod/Dockerfile-5.4), [`5.5-prod`](Dockerfiles/prod/Dockerfile-5.5), [`5.6-prod`](Dockerfiles/prod/Dockerfile-5.6), [`7.0-prod`](Dockerfiles/prod/Dockerfile-7.0), [`7.1-prod`](Dockerfiles/prod/Dockerfile-7.1), [`7.2-prod`](Dockerfiles/prod/Dockerfile-7.2), [`7.3-prod`](Dockerfiles/prod/Dockerfile-7.3), [`7.4-prod`](Dockerfiles/prod/Dockerfile-7.4), [`8.0-prod`](Dockerfiles/prod/Dockerfile-8.0), [`8.1-prod`](Dockerfiles/prod/Dockerfile-8.1), [`8.2-prod`](Dockerfiles/prod/Dockerfile-8.2) +* [`5.2-work`](Dockerfiles/work/Dockerfile-5.2), [`5.3-work`](Dockerfiles/work/Dockerfile-5.3), [`5.4-work`](Dockerfiles/work/Dockerfile-5.4), [`5.5-work`](Dockerfiles/work/Dockerfile-5.5), [`5.6-work`](Dockerfiles/work/Dockerfile-5.6), [`7.0-work`](Dockerfiles/work/Dockerfile-7.0), [`7.1-work`](Dockerfiles/work/Dockerfile-7.1), [`7.2-work`](Dockerfiles/work/Dockerfile-7.2), [`7.3-work`](Dockerfiles/work/Dockerfile-7.3), [`7.4-work`](Dockerfiles/work/Dockerfile-7.4), [`8.0-work`](Dockerfiles/work/Dockerfile-8.0), [`8.1-work`](Dockerfiles/work/Dockerfile-8.1), [`8.2-work`](Dockerfiles/work/Dockerfile-8.2) ----- - -

Motivation

- -One main problem with a running Docker container is to **synchronize the ownership of files in a mounted volume** in order to preserve security (Not having to use `chmod 0777`). +:information_source: For details see **[Documentation: Docker Tags](doc/docker-tags.md)**
+:information_source: For details see **[Documentation: Supported Architectures](doc/supported-architectures.md)** -#### Unsynchronized permissions +

PHP Versions

-Consider the following directory structure of a mounted volume. Your hosts computer uid/gid are `1000` which does not have a corresponding user/group within the container. Fortunately the `tmp/` directory allows everybody to create new files in it. +The following PHP versions are provided by this repository. -```shell - [Host] | [Container] ------------------------------------------------------------------------------------------- - $ ls -l | $ ls -l - -rw-r--r-- user group index.php | -rw-r--r-- 1000 1000 index.php - drwxrwxrwx user group tmp/ | drwxrwxrwx 1000 1000 tmp/ -``` +* `PHP 5.2`, `PHP 5.3`, `PHP 5.4`, `PHP 5.5`, `PHP 5.6` +* `PHP 7.0`, `PHP 7.1`, `PHP 7.2`, `PHP 7.3`, `PHP 7.4` +* `PHP 8.0`, `PHP 8.1`, `PHP 8.2` -Your web application might now have created some temporary files (via the PHP-FPM process) inside the `tmp/` directory: +> **Note:** Unreleased PHP versions are built from custom base images. -```shell - [Host] | [Container] ------------------------------------------------------------------------------------------- - $ ls -l tmp/ | $ ls -l tmp/ - -rw-r--r-- 96 96 _tmp_cache01.php | -rw-r--r-- www www _tmp_cache01.php - -rw-r--r-- 96 96 _tmp_cache02.php | -rw-r--r-- www www _tmp_cache01.php -``` - -On the Docker container side everything is still fine, but on your host computers side, those files now show a user id and group id of `96`, which is in fact the uid/gid of the PHP-FPM process running inside the container. On the host side you will now have to use `sudo` in order to delete/edit those files. - -#### It gets even worse - -Consider your had created the `tmp/` directory on your host only with `0775` permissions: - -```shell - [Host] | [Container] ------------------------------------------------------------------------------------------- - $ ls -l | $ ls -l - -rw-r--r-- user group index.php | -rw-r--r-- 1000 1000 index.php - drwxrwxr-x user group tmp/ | drwxrwxr-x 1000 1000 tmp/ -``` - -If your web application now wants to create some temporary files (via the PHP-FPM process) inside the `tmp/` directory, it will fail due to lacking permissions. - -#### The solution - -To overcome this problem, it must be made sure that the PHP-FPM process inside the container runs under the same uid/gid as your local user that mouns the volumes and also wants to work on those files locally. However, you never know during Image build time what user id this would be. Therefore it must be something that can be changed during startup of the container. - -This is achieved by two environment variables that can be provided during startup in order to change the uid/gid of the PHP-FPM user prior starting up PHP-FPM. - -```shell -$ docker run -e NEW_UID=1000 -e NEW_GID=1000 -it devilbox/php-fpm:7.2-base -[INFO] Changing user 'devilbox' uid to: 1000 -root $ usermod -u 1000 devilbox -[INFO] Changing group 'devilbox' gid to: 1000 -root $ groupmod -g 1000 devilbox -[INFO] Starting PHP 7.2.0 (fpm-fcgi) (built: Oct 30 2017 12:05:19) -``` - -When **`NEW_UID`** and **`NEW_GID`** are provided to the startup command, the container will do a `usermod` and `groupmod` prior starting up in order to assign new uid/gid to the PHP-FPM user. When the PHP-FPM process finally starts up it actually runs with your local system user and making sure permissions will be in sync from now on. - -At a minimum those two environment variables are offered by all flavours and types of the here provided PHP-FPM images. - -**Note:** - -To tackle this on the PHP-FPM side is only half a solution to the problem. The same applies to a web server Docker container when you offer **file uploads**. They will be uploaded and created by the web servers uid/gid. Therefore the web server itself must also provide the same kind of solution. See the following Web server Docker images for how this is done: - -**[Apache 2.2](https://github.com/devilbox/docker-apache-2.2)** | -**[Apache 2.4](https://github.com/devilbox/docker-apache-2.4)** | -**[Nginx stable](https://github.com/devilbox/docker-nginx-stable)** | -**[Nginx mainline](https://github.com/devilbox/docker-nginx-mainline)** +:information_source: For details see **[Documentation: PHP Versions](doc/php-versions.md)**
+:information_source: For details see **[Documentation: Base Images](doc/base-images.md)** -

PHP-FPM Flavours

- -#### Assembly +

Flavours

The provided Docker images heavily rely on inheritance to guarantee smallest possible image size. Each of them provide a working PHP-FPM server and you must decide what version works best for you. Look at the sketch below to get an overview about the two provided flavours and each of their different types. @@ -209,779 +75,191 @@ The provided Docker images heavily rely on inheritance to guarantee smallest pos # (sudo, custom bash and tool configs) ``` -#### Available Images - -The following table shows a more complete overview about the offered Docker images and what they should be used for. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDocker ImageDescription
basedevilbox/php-fpm:5.2-base - - -
devilbox/php-fpm:5.3-base - - -
devilbox/php-fpm:5.4-base - - -
devilbox/php-fpm:5.5-base - - -
devilbox/php-fpm:5.6-base - - -
devilbox/php-fpm:7.0-base - - -
devilbox/php-fpm:7.1-base - - -
devilbox/php-fpm:7.2-base - - -
devilbox/php-fpm:7.3-base - - -
devilbox/php-fpm:7.4-base - - -
devilbox/php-fpm:8.0-base - - -
devilbox/php-fpm:8.1-base - - -
devilbox/php-fpm:8.2-base - - -
modsdevilbox/php-fpm:5.2-mods - - -
devilbox/php-fpm:5.3-mods - - -
devilbox/php-fpm:5.4-mods - - -
devilbox/php-fpm:5.5-mods - - -
devilbox/php-fpm:5.6-mods - - -
devilbox/php-fpm:7.0-mods - - -
devilbox/php-fpm:7.1-mods - - -
devilbox/php-fpm:7.2-mods - - -
devilbox/php-fpm:7.3-mods - - -
devilbox/php-fpm:7.4-mods - - -
devilbox/php-fpm:8.0-mods - - -
devilbox/php-fpm:8.1-mods - - -
devilbox/php-fpm:8.2-mods - - -
proddevilbox/php-fpm:5.2-prod - - -
devilbox/php-fpm:5.3-prod - - -
devilbox/php-fpm:5.4-prod - - -
devilbox/php-fpm:5.5-prod - - -
devilbox/php-fpm:5.6-prod - - -
devilbox/php-fpm:7.0-prod - - -
devilbox/php-fpm:7.1-prod - - -
devilbox/php-fpm:7.2-prod - - -
devilbox/php-fpm:7.3-prod - - -
devilbox/php-fpm:7.4-prod - - -
devilbox/php-fpm:8.0-prod - - -
devilbox/php-fpm:8.1-prod - - -
devilbox/php-fpm:8.2-prod - - -
workdevilbox/php-fpm:5.2-work - - -
devilbox/php-fpm:5.3-work - - -
devilbox/php-fpm:5.4-work - - -
devilbox/php-fpm:5.5-work - - -
devilbox/php-fpm:5.6-work - - -
devilbox/php-fpm:7.0-work - - -
devilbox/php-fpm:7.1-work - - -
devilbox/php-fpm:7.2-work - - -
devilbox/php-fpm:7.3-work - - -
devilbox/php-fpm:7.4-work - - -
devilbox/php-fpm:8.0-work - - -
devilbox/php-fpm:8.1-work - - -
devilbox/php-fpm:8.2-work - - -
+:information_source: For details see **[Documentation: Flavours](doc/flavours.md)**
+:information_source: For details see **[Documentation: Base Images](doc/base-images.md)** -#### Tagging +

Available PHP extensions

-This repository uses Docker tags to refer to different flavours and types of the PHP-FPM Docker image. Therefore `:latest` and `:` as well as `:` must be presented differently. Refer to the following table to see how tagged Docker images are produced at Docker hub: + - - - - - - - - - - - - - - - - - - - - - - - - - -
Meant TagActual TagComment
:latest - :X.Y-base
- :X.Y-mods
- :X.Y-prod
- :X.Y-work
-
Stable
(rolling)

These tags are produced by the master branch of this repository.
:<git-tag-name> - :X.Y-base-<git-tag-name>
- :X.Y-mods-<git-tag-name>
- :X.Y-prod-<git-tag-name>
- :X.Y-work-<git-tag-name>
-
Stable
(fixed)

Every git tag will produce and preserve these Docker tags.
:<git-branch-name> - :X.Y-base-<git-branch-name>
- :X.Y-mods-<git-branch-name>
- :X.Y-prod-<git-branch-name>
- :X.Y-work-<git-branch-name>
-
Feature
(for testing)

Tags produced by unmerged branches. Do not rely on them as they might come and go.
+[`amqp`](php_modules/amqp/) +[`apc`](php_modules/apc/) +[`apcu`](php_modules/apcu/) +[`bcmath`](php_modules/bcmath/) +[`blackfire`](php_modules/blackfire/) +[`bz2`](php_modules/bz2/) +[`calendar`](php_modules/calendar/) +[`ctype`](php_modules/ctype/) +[`curl`](php_modules/curl/) +[`date`](php_modules/date/) +[`dba`](php_modules/dba/) +[`dom`](php_modules/dom/) +[`enchant`](php_modules/enchant/) +[`ereg`](php_modules/ereg/) +[`exif`](php_modules/exif/) +[`FFI`](php_modules/ffi/) +[`fileinfo`](php_modules/fileinfo/) +[`filter`](php_modules/filter/) +[`ftp`](php_modules/ftp/) +[`gd`](php_modules/gd/) +[`gettext`](php_modules/gettext/) +[`gmp`](php_modules/gmp/) +[`hash`](php_modules/hash/) +[`iconv`](php_modules/iconv/) +[`igbinary`](php_modules/igbinary/) +[`imagick`](php_modules/imagick/) +[`imap`](php_modules/imap/) +[`interbase`](php_modules/interbase/) +[`intl`](php_modules/intl/) +[`ioncube`](php_modules/ioncube/) +[`json`](php_modules/json/) +[`ldap`](php_modules/ldap/) +[`libxml`](php_modules/libxml/) +[`mbstring`](php_modules/mbstring/) +[`mcrypt`](php_modules/mcrypt/) +[`memcache`](php_modules/memcache/) +[`memcached`](php_modules/memcached/) +[`mhash`](php_modules/mhash/) +[`mongo`](php_modules/mongo/) +[`mongodb`](php_modules/mongodb/) +[`msgpack`](php_modules/msgpack/) +[`mysql`](php_modules/mysql/) +[`mysqli`](php_modules/mysqli/) +[`mysqlnd`](php_modules/mysqlnd/) +[`OAuth`](php_modules/oauth/) +[`oci8`](php_modules/oci8/) +[`OPcache`](php_modules/opcache/) +[`openssl`](php_modules/openssl/) +[`pcntl`](php_modules/pcntl/) +[`pcre`](php_modules/pcre/) +[`PDO`](php_modules/pdo/) +[`pdo_dblib`](php_modules/pdo_dblib/) +[`PDO_Firebird`](php_modules/pdo_firebird/) +[`pdo_mysql`](php_modules/pdo_mysql/) +[`PDO_OCI`](php_modules/pdo_oci/) +[`pdo_pgsql`](php_modules/pdo_pgsql/) +[`pdo_sqlite`](php_modules/pdo_sqlite/) +[`pdo_sqlsrv`](php_modules/pdo_sqlsrv/) +[`pgsql`](php_modules/pgsql/) +[`phalcon`](php_modules/phalcon/) +[`Phar`](php_modules/phar/) +[`posix`](php_modules/posix/) +[`pspell`](php_modules/pspell/) +[`psr`](php_modules/psr/) +[`random`](php_modules/random/) +[`rdkafka`](php_modules/rdkafka/) +[`readline`](php_modules/readline/) +[`recode`](php_modules/recode/) +[`redis`](php_modules/redis/) +[`Reflection`](php_modules/reflection/) +[`session`](php_modules/session/) +[`shmop`](php_modules/shmop/) +[`SimpleXML`](php_modules/simplexml/) +[`snmp`](php_modules/snmp/) +[`soap`](php_modules/soap/) +[`sockets`](php_modules/sockets/) +[`sodium`](php_modules/sodium/) +[`solr`](php_modules/solr/) +[`SPL`](php_modules/spl/) +[`sqlite`](php_modules/sqlite/) +[`sqlite3`](php_modules/sqlite3/) +[`sqlsrv`](php_modules/sqlsrv/) +[`ssh2`](php_modules/ssh2/) +[`swoole`](php_modules/swoole/) +[`sysvmsg`](php_modules/sysvmsg/) +[`sysvsem`](php_modules/sysvsem/) +[`sysvshm`](php_modules/sysvshm/) +[`tidy`](php_modules/tidy/) +[`tokenizer`](php_modules/tokenizer/) +[`uploadprogress`](php_modules/uploadprogress/) +[`uuid`](php_modules/uuid/) +[`wddx`](php_modules/wddx/) +[`vips`](php_modules/vips/) +[`Xdebug`](php_modules/xdebug/) +[`xlswriter`](php_modules/xlswriter/) +[`xml`](php_modules/xml/) +[`xmlreader`](php_modules/xmlreader/) +[`xmlrpc`](php_modules/xmlrpc/) +[`xmlwriter`](php_modules/xmlwriter/) +[`xsl`](php_modules/xsl/) +[`yaml`](php_modules/yaml/) +[`zip`](php_modules/zip/) +[`zlib`](php_modules/zlib/) - -#### PHP Modules - -Check out this table to see which Docker image provides what PHP modules. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
basemods, prod and work
5.2ctype, curl, date, dom, filter, ftp, hash, iconv, json, libxml, mbstring, mhash, openssl, pcre, PDO, pdo_sqlite, posix, readline, recode, Reflection, session, SimpleXML, SPL, SQLite, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, bcmath, bz2, calendar, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mhash, mongo, msgpack, mysql, mysqli, OAuth, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, SQLite, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib
5.3Core, ctype, curl, date, dom, ereg, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mhash, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, recode, Reflection, session, SimpleXML, SPL, SQLite, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apc, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mhash, mongo, mongodb, msgpack, mysql, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, posix, pspell, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, SQLite, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
5.4Core, ctype, curl, date, dom, ereg, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mhash, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, recode, Reflection, session, SimpleXML, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apc, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mhash, mongo, mongodb, msgpack, mysql, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
5.5Core, ctype, curl, date, dom, ereg, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mhash, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, recode, Reflection, session, SimpleXML, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apc, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mhash, mongo, mongodb, msgpack, mysql, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
5.6Core, ctype, curl, date, dom, ereg, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mhash, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apc, apcu, bcmath, blackfire, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mhash, mongo, mongodb, msgpack, mysql, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
7.0Core, ctype, curl, date, dom, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, blackfire, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, sqlsrv, ssh2, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, vips, wddx, xdebug, xlswriter, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
7.1Core, ctype, curl, date, dom, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, blackfire, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, solr, SPL, sqlite3, sqlsrv, ssh2, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, vips, wddx, xdebug, xlswriter, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
7.2Core, ctype, curl, date, dom, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, blackfire, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, solr, SPL, sqlite3, sqlsrv, ssh2, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, vips, wddx, xdebug, xlswriter, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
7.3Core, ctype, curl, date, dom, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, blackfire, bz2, calendar, Core, ctype, curl, date, dba, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, interbase, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, solr, SPL, sqlite3, sqlsrv, ssh2, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, vips, wddx, xdebug, xlswriter, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
7.4Core, ctype, curl, date, dom, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, blackfire, bz2, calendar, Core, ctype, curl, date, dba, dom, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, intl, ioncube, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, solr, SPL, sqlite3, sqlsrv, ssh2, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, vips, xdebug, xlswriter, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
8.0Core, ctype, curl, date, dom, FFI, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, blackfire, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, solr, SPL, sqlite3, sqlsrv, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, vips, xdebug, xlswriter, xml, xmlreader, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
8.1Core, ctype, curl, date, dom, FFI, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, intl, json, ldap, libxml, mbstring, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, phalcon, Phar, posix, pspell, psr, rdkafka, readline, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, solr, SPL, sqlite3, sqlsrv, standard, swoole, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, vips, xdebug, xlswriter, xml, xmlreader, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
8.2Core, ctype, curl, date, dom, FFI, fileinfo, filter, ftp, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlibamqp, apcu, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, enchant, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, intl, json, ldap, libxml, mbstring, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, OAuth, oci8, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, Phar, posix, pspell, psr, rdkafka, readline, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, sodium, SPL, sqlite3, sqlsrv, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, uuid, xdebug, xlswriter, xml, xmlreader, xmlwriter, xsl, yaml, Zend OPcache, zip, zlib
+:information_source: For detauls see **[Documentation: PHP Modules](doc/php-modules.md)** -

PHP-FPM Features

+

Environment Variables

-#### Image: base -```shell -docker pull devilbox/php-fpm:5.2-base -docker pull devilbox/php-fpm:5.3-base -docker pull devilbox/php-fpm:5.4-base -docker pull devilbox/php-fpm:5.5-base -docker pull devilbox/php-fpm:5.6-base -docker pull devilbox/php-fpm:7.0-base -docker pull devilbox/php-fpm:7.1-base -docker pull devilbox/php-fpm:7.2-base -docker pull devilbox/php-fpm:7.3-base -docker pull devilbox/php-fpm:7.4-base -docker pull devilbox/php-fpm:8.0-base -docker pull devilbox/php-fpm:8.1-base -docker pull devilbox/php-fpm:8.2-base -``` +The provided Docker images offer environment variables to alter their startup behaviour. -Generic PHP-FPM base image. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.

(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`) +:information_source: For details see **[Documentation: Flavours](doc/flavours.md)**
+:information_source: For details see **[Documentation: Environment Variables](doc/docker-env-variables.md)**
-#### Image: mods -```shell -docker pull devilbox/php-fpm:5.2-mods -docker pull devilbox/php-fpm:5.3-mods -docker pull devilbox/php-fpm:5.4-mods -docker pull devilbox/php-fpm:5.5-mods -docker pull devilbox/php-fpm:5.6-mods -docker pull devilbox/php-fpm:7.0-mods -docker pull devilbox/php-fpm:7.1-mods -docker pull devilbox/php-fpm:7.2-mods -docker pull devilbox/php-fpm:7.3-mods -docker pull devilbox/php-fpm:7.4-mods -docker pull devilbox/php-fpm:8.0-mods -docker pull devilbox/php-fpm:8.1-mods -docker pull devilbox/php-fpm:8.2-mods -``` +#### Flavour: base -Generic PHP-FPM image with fully loaded extensions. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.

(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`) +`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID` -#### Image: prod -```shell -docker pull devilbox/php-fpm:5.2-prod -docker pull devilbox/php-fpm:5.3-prod -docker pull devilbox/php-fpm:5.4-prod -docker pull devilbox/php-fpm:5.5-prod -docker pull devilbox/php-fpm:5.6-prod -docker pull devilbox/php-fpm:7.0-prod -docker pull devilbox/php-fpm:7.1-prod -docker pull devilbox/php-fpm:7.2-prod -docker pull devilbox/php-fpm:7.3-prod -docker pull devilbox/php-fpm:7.4-prod -docker pull devilbox/php-fpm:8.0-prod -docker pull devilbox/php-fpm:8.1-prod -docker pull devilbox/php-fpm:8.2-prod -``` +#### Flavour: mods -Devilbox production image. This Docker image comes with many injectables, port-forwardings, mail-catch-all and user/group rewriting. +`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID` -#### Image: work -```shell -docker pull devilbox/php-fpm:5.2-work -docker pull devilbox/php-fpm:5.3-work -docker pull devilbox/php-fpm:5.4-work -docker pull devilbox/php-fpm:5.5-work -docker pull devilbox/php-fpm:5.6-work -docker pull devilbox/php-fpm:7.0-work -docker pull devilbox/php-fpm:7.1-work -docker pull devilbox/php-fpm:7.2-work -docker pull devilbox/php-fpm:7.3-work -docker pull devilbox/php-fpm:7.4-work -docker pull devilbox/php-fpm:8.0-work -docker pull devilbox/php-fpm:8.1-work -docker pull devilbox/php-fpm:8.2-work -``` +#### Flavour: prod -Devilbox development image. Same as prod, but comes with lots of locally installed tools to make development inside the container as convenient as possible. See [Integrated Development Environment](#integrated-development-environment) for more information about this. +`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID`, `TIMEZONE`, `DOCKER_LOGS`, `ENABLE_MODULES`, `DISABLE_MODULES`, `ENABLE_MAIL`, `FORWARD_PORTS_TO_LOCALHOST` + +#### Flavour: work + +`DEBUG_ENTRYPOINT`, `NEW_UID`, `NEW_GID`, `TIMEZONE`, `DOCKER_LOGS`, `ENABLE_MODULES`, `DISABLE_MODULES`, `ENABLE_MAIL`, `FORWARD_PORTS_TO_LOCALHOST`,` MYSQL_BACKUP_USER`, `MYSQL_BACKUP_PASS`, `MYSQL_BACKUP_HOST` -

PHP-FPM Options

+

Volumes

-#### Environment variables +The provided Docker images offer different volumes to be mounted -Have a look at the following table to see all supported environment variables for each Docker image flavour. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ImageEnv VariableTypeDefaultDescription
base

mods

prod

work
DEBUG_ENTRYPOINTint0Set debug level for startup.
0 Only warnings and errors are shown.
1 All log messages are shown
2 All log messages and executed commands are shown.
NEW_UIDint1000Assign the PHP-FPM user a new uid in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local user.
(Type id -u for your uid).
NEW_GIDint1000Assign the PHP-FPM group a new gid in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local group.
(Type id -g for your gid).
prod

work
TIMEZONEstringUTCSet docker OS timezone as well as PHP timezone.
(Example: Europe/Berlin)
DOCKER_LOGSbool1By default all Docker images are configured to output their PHP-FPM access and error logs to stdout and stderr. Those which support it can change the behaviour to log into files inside the container. Their respective directories are available as volumes that can be mounted to the host computer. This feature might help developer who are more comfortable with tailing or searching through actual files instead of using docker logs.

Set this variable to 0 in order to enable logging to files. Log files are avilable under /var/log/php/ which is also a docker volume that can be mounted locally.
ENABLE_MODULESstring''Comma separated list of PHP modules to enable, which are not enabled by default.
Example:
ENABLE_MODULES=blackfire, ioncube, psr, phalcon
DISABLE_MODULESstring''Comma separated list of PHP modules to disable.
Example:
DISABLE_MODULES=swoole,imagick
ENABLE_MAILbool0Start local postfix with or without email catch-all.
0: Postfix service disabled.
1: Postfix service started normally.
2: Postfix service started configured for local delivery and all mails sent (even to real domains) will be catched locally. No email will ever go out. They will all be stored in a local devilbox account.
Value: 0, 1 or 2
FORWARD_PORTS_TO_LOCALHOSTstringList of remote ports to forward to 127.0.0.1.
Format:
<local-port>:<remote-host>:<remote-port>
You can separate multiple entries by comma.
Example:
3306:mysqlhost:3306, 6379:192.0.1.1:6379
workMYSQL_BACKUP_USERstring''Username for mysql backups used for bundled mysqldump-secure
MYSQL_BACKUP_PASSstring''Password for mysql backups used for bundled mysqldump-secure
MYSQL_BACKUP_HOSTstring''Hostname for mysql backups used for bundled mysqldump-secure
+:information_source: For details see **[Documentation: Flavours](doc/flavours.md)**
+:information_source: For details see **[Documentation: Volumes](doc/docker-volumes.md)**
-#### Volumes +#### Flavour: base -Have a look at the following table to see all offered volumes for each Docker image flavour. +* None - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ImageVolumesDescription
prod

work
/etc/php-custom.dMount this directory into your host computer and add custom \*.ini files in order to alter php behaviour.
/etc/php-fpm-custom.dMount this directory into your host computer and add custom PHP-FPM \*.conf files in order to alter PHP-FPM behaviour.
/etc/php-modules.dMount this directory into your host computer and add custo \*.so files in order to add your php modules.

Note:Your should then also provide a custom \*.ini file in order to actually load your custom provided module.
/startup.1.dAny executable scripts ending by \*.sh found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run before /startup.2.d)
/startup.2.dAny executable scripts ending by \*.sh found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run after /startup.1.d)
/var/log/phpWhen setting environment variable DOCKER_LOGS to 0, log files will be available under this directory.
/var/mailEmails caught be the postfix catch-all (ENABLE_MAIL=2) will be available in this directory.
/etc/supervisor/custom.dMount this directory into your host computer and add your own `*.conf` supervisor start-up files.

**Note:** Directory and file permission will be recursively set to this of `NEW_UID` and `NEW_GID`.
work/etc/bashrc-devilbox.dMount this directory into your host computer and add custom configuration files for bash and other tools.
/shared/backupsMount this directory into your host computer to access MySQL backups created by mysqldump-secure.
/caMount this directory into your host computer to bake any *.crt file that is located in there as a trusted SSL entity.
+#### Flavour: mods + +* None + +#### Flavour: prod + +* **[`/etc/php-custom.d`]()**, **[`/etc/php-fpm-custom.d`]()** - *custom PHP/PHP-FPM config files* +* **[`/startup.1.d`]()**, **[`/startup.2.d`]()** - *custom startup scripts* +* **[`/var/log/php`]()**, **[`/var/mail`]()** - *logs and mail data* +* **[`/etc/supervisor/custom.d`]()** - *custom supervisord config files* + +#### Flavour: work + +* **[`/etc/php-custom.d`]()**, **[`/etc/php-fpm-custom.d`]()** - *custom PHP/PHP-FPM config files* +* **[`/startup.1.d`]()**, **[`/startup.2.d`]()** - *custom startup scripts* +* **[`/var/log/php`]()**, **[`/var/mail`]()** - *logs and mail data* +* **[`/etc/supervisor/custom.d`]()** - *custom supervisord config files* +* **[`/etc/bashrc-devilbox.d`]()** - *custom bashrc config files* +* **[`/shared/backups`]()** - *backup data* +* **[`/ca`]()** - *trusted Certificate Authorities* -#### Ports +

Ports

Have a look at the following table to see all offered exposed ports for each Docker image flavour. - + @@ -1019,172 +297,7 @@ The **work** Docker image has many common tools already installed which on one h You want to use tools such as `git`, `drush`, `composer`, `npm`, `eslint`, `phpcs` as well as many others, simply do it directly inside the container. As all Docker images are auto-built every night by GitHub Actions it is assured that you are always at the latest version of your favorite dev tool. - -#### What tools can you expect - -
ImageFlavour Port Description
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ToolDescription
AnsibleAutomation tool.
asgardcmsAsgardCMS cli installer.
awesome-ciVarious linting and source code analyzing tools.
codeceptionElegant and efficient testing for PHP.
composerDependency Manager for PHP.
deployerDeployment tool for PHP.
drupal-consoleThe Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
drushDrush is a computer software shell-based application used to control, manipulate, and administer Drupal websites.
eslintThe pluggable linting utility for JavaScript and JSX.
gitGit is a version control system for tracking changes in source files.
git-flowGit-flow tools.
gulpGulp command line JS tool.
gruntGrunt command line JS tool.
HomebrewThe Missing Package Manager for macOS (or Linux).
jsonlintJson command line linter.
jqCommand-line JSON processor.
laravel installerA CLI tool to easily install and manage the laravel framework.
linkcheckSearch for URLs in files (optionally limited by extension) and validate their HTTP status code.
mdlMarkdown command line linter.
mdlintMarkdown command line linter.
mysqldump-secureSecury MySQL database backup tool with encryption.
nodejsNode.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side.
npmnpm is a package manager for the JavaScript programming language.
phalcon-devtoolsCLI tool to generate code helping to develop faster and easy applications that use with Phalcon framework.
phpcsPHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
phpcbfPHP Code Beautifier and Fixer.
php-cs-fixerA tool to automatically fix PHP Coding Standards issues.
phpmdPHP Mess Detector.
photonPhoton CMS cli.
sassSass CSS compiler.
stylelintSass/CSS command line linter.
sshOpenSSH command line client.
symfony installerThis is the official installer to start new projects based on the Symfony full-stack framework.
tigText-mode Interface for Git.
webpackA bundler for javascript and friends.
wp-cliWP-CLI is the command-line interface for WordPress.
yamllintYaml command line linter.
yarnFast, reliable and secure dependency management.
- +:information_source: For details see **[Documentation: Available Tools](doc/available-tools.md)** #### What else is available @@ -1193,7 +306,6 @@ Apart from the provided tools, you will also be able to use the container simila * Mount custom bash configuration files so your config persists between restarts * Use password-less `sudo` to become root and do whatever you need to do -If there is anything else you'd like to be able to do, drop me an issue.

Examples

@@ -1330,13 +442,61 @@ $ docker exec -it php mysqldump-secure Docker images are built and tested every night by **[GitHub Actions](https://github.com/devilbox/docker-php-fpm/actions?workflow=nightly)** and pushed to **[Docker hub](https://hub.docker.com/r/devilbox/php-fpm/)** on success. This is all done automatically to ensure that sources as well as base images are always fresh and in case of security updates always have the latest patches. +

Contributing

Contributors are welcome. Feel free to star and clone this repository and submit issues and pull-requests. Add examples and show what you have created with the provided images. If you see any errors or ways to improve this repository in any way, please do so. + +

Community

+ +In case you seek help, go and visit the community pages. + + + + + + + + + + + + + + + + + + + + + +

Documentation

Chat

Forum

+ + + + + + + + + + + +
devilbox.readthedocs.iogitter.im/devilboxdevilbox.discourse.group
+ +

Credits

-* **[cytopia](https://github.com/cytopia)** +- **[@cytopia](https://github.com/cytopia)** +- **[@mrLexx](https://github.com/mrLexx)** +- **[@fibis](https://github.com/fibis)** +- **[@llaville](https://github.com/llaville)** +- **[@anatolinicolae](https://github.com/anatolinicolae)** +- **[@fschndr](https://github.com/fschndr)** +- **[@Tuurlijk](https://github.com/Tuurlijk)** +

License

diff --git a/doc/available-tools.md b/doc/available-tools.md new file mode 100644 index 0000000..df510e0 --- /dev/null +++ b/doc/available-tools.md @@ -0,0 +1,183 @@ +[Permissions](syncronize-file-permissions.md) | +[Tags](docker-tags.md) | +[Architectures](supported-architectures.md) | +[Versions](php-versions.md) | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +Tools | +[Env Vars](docker-env-variables.md) | +[Volumes](docker-volumes.md) | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Available Tools + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ToolDescription
AnsibleAutomation tool.
asgardcmsAsgardCMS cli installer.
awesome-ciVarious linting and source code analyzing tools.
codeceptionElegant and efficient testing for PHP.
composerDependency Manager for PHP.
deployerDeployment tool for PHP.
drupal-consoleThe Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
drushDrush is a computer software shell-based application used to control, manipulate, and administer Drupal websites.
eslintThe pluggable linting utility for JavaScript and JSX.
gitGit is a version control system for tracking changes in source files.
git-flowGit-flow tools.
gulpGulp command line JS tool.
gruntGrunt command line JS tool.
HomebrewThe Missing Package Manager for macOS (or Linux).
jsonlintJson command line linter.
jqCommand-line JSON processor.
laravel installerA CLI tool to easily install and manage the laravel framework.
linkcheckSearch for URLs in files (optionally limited by extension) and validate their HTTP status code.
mdlMarkdown command line linter.
mdlintMarkdown command line linter.
mysqldump-secureSecury MySQL database backup tool with encryption.
nodejsNode.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side.
npmnpm is a package manager for the JavaScript programming language.
phalcon-devtoolsCLI tool to generate code helping to develop faster and easy applications that use with Phalcon framework.
phpcsPHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
phpcbfPHP Code Beautifier and Fixer.
php-cs-fixerA tool to automatically fix PHP Coding Standards issues.
phpmdPHP Mess Detector.
photonPhoton CMS cli.
sassSass CSS compiler.
stylelintSass/CSS command line linter.
sshOpenSSH command line client.
symfony installerThis is the official installer to start new projects based on the Symfony full-stack framework.
tigText-mode Interface for Git.
webpackA bundler for javascript and friends.
wp-cliWP-CLI is the command-line interface for WordPress.
yamllintYaml command line linter.
yarnFast, reliable and secure dependency management.
+ + diff --git a/doc/base-images.md b/doc/base-images.md new file mode 100644 index 0000000..26bf9e1 --- /dev/null +++ b/doc/base-images.md @@ -0,0 +1,27 @@ +[Permissions](syncronize-file-permissions.md) | +[Tags](docker-tags.md) | +[Architectures](supported-architectures.md) | +[Versions](php-versions.md) | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +[Env Vars](docker-env-variables.md) | +[Volumes](docker-volumes.md) | +Base Images + +--- + +

Documentation

+ + + +### Base Images + +Have a look at the following Devilbox base images for which no official versions exist yet, but are required to serve as a foundation for this repository: + +* [PHP-FPM 5.2](https://github.com/devilbox/docker-php-fpm-5.2) +* [PHP-FPM 5.3](https://github.com/devilbox/docker-php-fpm-5.3) +* [PHP-FPM 7.4](https://github.com/devilbox/docker-php-fpm-7.4) +* [PHP-FPM 8.0](https://github.com/devilbox/docker-php-fpm-8.0) +* [PHP-FPM 8.1](https://github.com/devilbox/docker-php-fpm-8.1) +* [PHP-FPM 8.2](https://github.com/devilbox/docker-php-fpm-8.2) diff --git a/doc/docker-env-variables.md b/doc/docker-env-variables.md new file mode 100644 index 0000000..2c2aa33 --- /dev/null +++ b/doc/docker-env-variables.md @@ -0,0 +1,116 @@ +[Permissions](syncronize-file-permissions.md) | +[Tags](docker-tags.md) | +[Architectures](supported-architectures.md) | +[Versions](php-versions.md) | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +Env Vars | +[Volumes](docker-volumes.md) | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Environment Variables + +Have a look at the following table to see all supported environment variables for each Docker image flavour. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ImageEnv VariableTypeDefaultDescription
base

mods

prod

work
DEBUG_ENTRYPOINTint0Set debug level for startup.
0 Only warnings and errors are shown.
1 All log messages are shown
2 All log messages and executed commands are shown.
NEW_UIDint1000Assign the PHP-FPM user a new uid in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local user.
(Type id -u for your uid).
NEW_GIDint1000Assign the PHP-FPM group a new gid in order to syncronize file system permissions with your host computer and the Docker container. You should use a value that matches your host systems local group.
(Type id -g for your gid).
prod

work
TIMEZONEstringUTCSet docker OS timezone as well as PHP timezone.
(Example: Europe/Berlin)
DOCKER_LOGSbool1By default all Docker images are configured to output their PHP-FPM access and error logs to stdout and stderr. Those which support it can change the behaviour to log into files inside the container. Their respective directories are available as volumes that can be mounted to the host computer. This feature might help developer who are more comfortable with tailing or searching through actual files instead of using docker logs.

Set this variable to 0 in order to enable logging to files. Log files are avilable under /var/log/php/ which is also a docker volume that can be mounted locally.
ENABLE_MODULESstring''Comma separated list of PHP modules to enable, which are not enabled by default.
Example:
ENABLE_MODULES=blackfire, ioncube, psr, phalcon
DISABLE_MODULESstring''Comma separated list of PHP modules to disable.
Example:
DISABLE_MODULES=swoole,imagick
ENABLE_MAILbool0Start local postfix with or without email catch-all.
0: Postfix service disabled.
1: Postfix service started normally.
2: Postfix service started configured for local delivery and all mails sent (even to real domains) will be catched locally. No email will ever go out. They will all be stored in a local devilbox account.
Value: 0, 1 or 2
FORWARD_PORTS_TO_LOCALHOSTstringList of remote ports to forward to 127.0.0.1.
Format:
<local-port>:<remote-host>:<remote-port>
You can separate multiple entries by comma.
Example:
3306:mysqlhost:3306, 6379:192.0.1.1:6379
workMYSQL_BACKUP_USERstring''Username for mysql backups used for bundled mysqldump-secure
MYSQL_BACKUP_PASSstring''Password for mysql backups used for bundled mysqldump-secure
MYSQL_BACKUP_HOSTstring''Hostname for mysql backups used for bundled mysqldump-secure
+ + diff --git a/doc/docker-tags.md b/doc/docker-tags.md new file mode 100644 index 0000000..8a241bb --- /dev/null +++ b/doc/docker-tags.md @@ -0,0 +1,298 @@ +[Permissions](syncronize-file-permissions.md) | +Tags | +[Architectures](supported-architectures.md) | +[Versions](php-versions.md) | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +[Env Vars](docker-env-variables.md) | +[Volumes](docker-volumes.md) | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Docker Tags + +#### Tagging Idea + +This repository uses Docker tags to refer to different flavours and types of the PHP-FPM Docker image. Therefore `:latest` and `:` as well as `:` must be presented differently. Refer to the following table to see how tagged Docker images are produced at Docker hub: + + + + + + + + + + + + + + + + + + + + + + + + + + +
Meant TagActual TagComment
:latest + :X.Y-base
+ :X.Y-mods
+ :X.Y-prod
+ :X.Y-work
+
Stable
(rolling)

These tags are produced by the master branch of this repository.
:<git-tag-name> + :X.Y-base-<git-tag-name>
+ :X.Y-mods-<git-tag-name>
+ :X.Y-prod-<git-tag-name>
+ :X.Y-work-<git-tag-name>
+
Stable
(fixed)

Every git tag will produce and preserve these Docker tags.
:<git-branch-name> + :X.Y-base-<git-branch-name>
+ :X.Y-mods-<git-branch-name>
+ :X.Y-prod-<git-branch-name>
+ :X.Y-work-<git-branch-name>
+
Feature
(for testing)

Tags produced by unmerged branches. Do not rely on them as they might come and go.
+ + +#### Available Docker Tags + +The following table shows a more complete overview about the offered Docker image tags. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlavourMaster BranchGit Tag
basedevilbox/php-fpm:5.2-basedevilbox/php-fpm:5.2-base-<git-tag>
devilbox/php-fpm:5.3-basedevilbox/php-fpm:5.3-base-<git-tag>
devilbox/php-fpm:5.4-basedevilbox/php-fpm:5.4-base-<git-tag>
devilbox/php-fpm:5.5-basedevilbox/php-fpm:5.5-base-<git-tag>
devilbox/php-fpm:5.6-basedevilbox/php-fpm:5.6-base-<git-tag>
devilbox/php-fpm:7.0-basedevilbox/php-fpm:7.0-base-<git-tag>
devilbox/php-fpm:7.1-basedevilbox/php-fpm:7.1-base-<git-tag>
devilbox/php-fpm:7.2-basedevilbox/php-fpm:7.2-base-<git-tag>
devilbox/php-fpm:7.3-basedevilbox/php-fpm:7.3-base-<git-tag>
devilbox/php-fpm:7.4-basedevilbox/php-fpm:7.4-base-<git-tag>
devilbox/php-fpm:8.0-basedevilbox/php-fpm:8.0-base-<git-tag>
devilbox/php-fpm:8.1-basedevilbox/php-fpm:8.1-base-<git-tag>
devilbox/php-fpm:8.2-basedevilbox/php-fpm:8.2-base-<git-tag>
modsdevilbox/php-fpm:5.2-modsdevilbox/php-fpm:5.2-mods-<git-tag>
devilbox/php-fpm:5.3-modsdevilbox/php-fpm:5.3-mods-<git-tag>
devilbox/php-fpm:5.4-modsdevilbox/php-fpm:5.4-mods-<git-tag>
devilbox/php-fpm:5.5-modsdevilbox/php-fpm:5.5-mods-<git-tag>
devilbox/php-fpm:5.6-modsdevilbox/php-fpm:5.6-mods-<git-tag>
devilbox/php-fpm:7.0-modsdevilbox/php-fpm:7.0-mods-<git-tag>
devilbox/php-fpm:7.1-modsdevilbox/php-fpm:7.1-mods-<git-tag>
devilbox/php-fpm:7.2-modsdevilbox/php-fpm:7.2-mods-<git-tag>
devilbox/php-fpm:7.3-modsdevilbox/php-fpm:7.3-mods-<git-tag>
devilbox/php-fpm:7.4-modsdevilbox/php-fpm:7.4-mods-<git-tag>
devilbox/php-fpm:8.0-modsdevilbox/php-fpm:8.0-mods-<git-tag>
devilbox/php-fpm:8.1-modsdevilbox/php-fpm:8.1-mods-<git-tag>
devilbox/php-fpm:8.2-modsdevilbox/php-fpm:8.2-mods-<git-tag>
proddevilbox/php-fpm:5.2-proddevilbox/php-fpm:5.2-prod-<git-tag>
devilbox/php-fpm:5.3-proddevilbox/php-fpm:5.3-prod-<git-tag>
devilbox/php-fpm:5.4-proddevilbox/php-fpm:5.4-prod-<git-tag>
devilbox/php-fpm:5.5-proddevilbox/php-fpm:5.5-prod-<git-tag>
devilbox/php-fpm:5.6-proddevilbox/php-fpm:5.6-prod-<git-tag>
devilbox/php-fpm:7.0-proddevilbox/php-fpm:7.0-prod-<git-tag>
devilbox/php-fpm:7.1-proddevilbox/php-fpm:7.1-prod-<git-tag>
devilbox/php-fpm:7.2-proddevilbox/php-fpm:7.2-prod-<git-tag>
devilbox/php-fpm:7.3-proddevilbox/php-fpm:7.3-prod-<git-tag>
devilbox/php-fpm:7.4-proddevilbox/php-fpm:7.4-prod-<git-tag>
devilbox/php-fpm:8.0-proddevilbox/php-fpm:8.0-prod-<git-tag>
devilbox/php-fpm:8.1-proddevilbox/php-fpm:8.1-prod-<git-tag>
devilbox/php-fpm:8.2-proddevilbox/php-fpm:8.2-prod-<git-tag>
workdevilbox/php-fpm:5.2-workdevilbox/php-fpm:5.2-work-<git-tag>
devilbox/php-fpm:5.3-workdevilbox/php-fpm:5.3-work-<git-tag>
devilbox/php-fpm:5.4-workdevilbox/php-fpm:5.4-work-<git-tag>
devilbox/php-fpm:5.5-workdevilbox/php-fpm:5.5-work-<git-tag>
devilbox/php-fpm:5.6-workdevilbox/php-fpm:5.6-work-<git-tag>
devilbox/php-fpm:7.0-workdevilbox/php-fpm:7.0-work-<git-tag>
devilbox/php-fpm:7.1-workdevilbox/php-fpm:7.1-work-<git-tag>
devilbox/php-fpm:7.2-workdevilbox/php-fpm:7.2-work-<git-tag>
devilbox/php-fpm:7.3-workdevilbox/php-fpm:7.3-work-<git-tag>
devilbox/php-fpm:7.4-workdevilbox/php-fpm:7.4-work-<git-tag>
devilbox/php-fpm:8.0-workdevilbox/php-fpm:8.0-work-<git-tag>
devilbox/php-fpm:8.1-workdevilbox/php-fpm:8.1-work-<git-tag>
devilbox/php-fpm:8.2-workdevilbox/php-fpm:8.2-work-<git-tag>
diff --git a/doc/docker-volumes.md b/doc/docker-volumes.md new file mode 100644 index 0000000..a618a22 --- /dev/null +++ b/doc/docker-volumes.md @@ -0,0 +1,83 @@ +[Permissions](syncronize-file-permissions.md) | +[Tags](docker-tags.md) | +[Architectures](supported-architectures.md) | +[Versions](php-versions.md) | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +[Env Vars](docker-env-variables.md) | +Volumes | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Docker Volumes + +Have a look at the following table to see all offered volumes for each Docker image flavour. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ImageVolumesDescription
prod

work
/etc/php-custom.dMount this directory into your host computer and add custom \*.ini files in order to alter php behaviour.
/etc/php-fpm-custom.dMount this directory into your host computer and add custom PHP-FPM \*.conf files in order to alter PHP-FPM behaviour.
/etc/php-modules.dMount this directory into your host computer and add custo \*.so files in order to add your php modules.

Note:Your should then also provide a custom \*.ini file in order to actually load your custom provided module.
/startup.1.dAny executable scripts ending by \*.sh found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run before /startup.2.d)
/startup.2.dAny executable scripts ending by \*.sh found in this directory will be executed during startup. This is useful to supply additional commands (such as installing custom software) when the container starts up. (will run after /startup.1.d)
/var/log/phpWhen setting environment variable DOCKER_LOGS to 0, log files will be available under this directory.
/var/mailEmails caught be the postfix catch-all (ENABLE_MAIL=2) will be available in this directory.
/etc/supervisor/custom.dMount this directory into your host computer and add your own `*.conf` supervisor start-up files.

**Note:** Directory and file permission will be recursively set to this of `NEW_UID` and `NEW_GID`.
work/etc/bashrc-devilbox.dMount this directory into your host computer and add custom configuration files for bash and other tools.
/shared/backupsMount this directory into your host computer to access MySQL backups created by mysqldump-secure.
/caMount this directory into your host computer to bake any *.crt file that is located in there as a trusted SSL entity.
+ + diff --git a/doc/flavours.md b/doc/flavours.md new file mode 100644 index 0000000..d7c3364 --- /dev/null +++ b/doc/flavours.md @@ -0,0 +1,34 @@ +[Permissions](syncronize-file-permissions.md) | +[Tags](docker-tags.md) | +[Architectures](supported-architectures.md) | +[Versions](php-versions.md) | +Flavours | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +[Env Vars](docker-env-variables.md) | +[Volumes](docker-volumes.md) | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Flavours + +#### Image: base + +Generic PHP-FPM base image. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.
(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`) + +#### Image: mods + +Generic PHP-FPM image with fully loaded extensions. Use it to derive your own php-fpm docker image from it and add more extensions, tools and injectables.
(Does not offer any environment variables except for `NEW_UID` and `NEW_GID`) + +#### Image: prod + +Devilbox production image. This Docker image comes with many injectables, port-forwardings, mail-catch-all and user/group rewriting. + +#### Image: work + +Devilbox development image. Same as prod, but comes with lots of locally installed tools to make development inside the container as convenient as possible. See [Integrated Development Environment](../README.md#integrated-development-environment) for more information about this. diff --git a/doc/php-versions.md b/doc/php-versions.md new file mode 100644 index 0000000..314fa3d --- /dev/null +++ b/doc/php-versions.md @@ -0,0 +1,34 @@ +[Permissions](syncronize-file-permissions.md) | +[Tags](docker-tags.md) | +[Architectures](supported-architectures.md) | +Versions | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +[Env Vars](docker-env-variables.md) | +[Volumes](docker-volumes.md) | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Available PHP versions + +| Version | Architecture | Flavours | +|---------------|---------------|----------| +| **`PHP 5.2`** | amd64 | [base](../Dockerfiles/base/Dockerfile-5.2), [mods](../Dockerfiles/mods/Dockerfile-5.2), [prod](../Dockerfiles/prod/Dockerfile-5.2), [work](../Dockerfiles/work/Dockerfile-5.2) | +| **`PHP 5.3`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.3), [mods](../Dockerfiles/mods/Dockerfile-5.3), [prod](../Dockerfiles/prod/Dockerfile-5.3), [work](../Dockerfiles/work/Dockerfile-5.3) | +| **`PHP 5.4`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.4), [mods](../Dockerfiles/mods/Dockerfile-5.4), [prod](../Dockerfiles/prod/Dockerfile-5.4), [work](../Dockerfiles/work/Dockerfile-5.4) | +| **`PHP 5.5`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.5), [mods](../Dockerfiles/mods/Dockerfile-5.5), [prod](../Dockerfiles/prod/Dockerfile-5.5), [work](../Dockerfiles/work/Dockerfile-5.5) | +| **`PHP 5.6`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-5.6), [mods](../Dockerfiles/mods/Dockerfile-5.6), [prod](../Dockerfiles/prod/Dockerfile-5.6), [work](../Dockerfiles/work/Dockerfile-5.6) | +| **`PHP 7.0`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.0), [mods](../Dockerfiles/mods/Dockerfile-7.0), [prod](../Dockerfiles/prod/Dockerfile-7.0), [work](../Dockerfiles/work/Dockerfile-7.0) | +| **`PHP 7.1`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.1), [mods](../Dockerfiles/mods/Dockerfile-7.1), [prod](../Dockerfiles/prod/Dockerfile-7.1), [work](../Dockerfiles/work/Dockerfile-7.1) | +| **`PHP 7.2`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.2), [mods](../Dockerfiles/mods/Dockerfile-7.2), [prod](../Dockerfiles/prod/Dockerfile-7.2), [work](../Dockerfiles/work/Dockerfile-7.2) | +| **`PHP 7.3`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.3), [mods](../Dockerfiles/mods/Dockerfile-7.3), [prod](../Dockerfiles/prod/Dockerfile-7.3), [work](../Dockerfiles/work/Dockerfile-7.3) | +| **`PHP 7.4`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-7.4), [mods](../Dockerfiles/mods/Dockerfile-7.4), [prod](../Dockerfiles/prod/Dockerfile-7.4), [work](../Dockerfiles/work/Dockerfile-7.4) | +| **`PHP 8.0`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-8.0), [mods](../Dockerfiles/mods/Dockerfile-8.0), [prod](../Dockerfiles/prod/Dockerfile-8.0), [work](../Dockerfiles/work/Dockerfile-8.0) | +| **`PHP 8.1`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-8.1), [mods](../Dockerfiles/mods/Dockerfile-8.1), [prod](../Dockerfiles/prod/Dockerfile-8.1), [work](../Dockerfiles/work/Dockerfile-8.1) | +| **`PHP 8.2`** | amd64, arm64 | [base](../Dockerfiles/base/Dockerfile-8.2), [mods](../Dockerfiles/mods/Dockerfile-8.2), [prod](../Dockerfiles/prod/Dockerfile-8.2), [work](../Dockerfiles/work/Dockerfile-8.2) | diff --git a/doc/supported-architectures.md b/doc/supported-architectures.md new file mode 100644 index 0000000..a51198a --- /dev/null +++ b/doc/supported-architectures.md @@ -0,0 +1,25 @@ +[Permissions](syncronize-file-permissions.md) | +[Tags](docker-tags.md) | +Architectures | +[Versions](php-versions.md) | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +[Env Vars](docker-env-variables.md) | +[Volumes](docker-volumes.md) | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Supported Architectures + +The following architectures are supported for **Linux**, **MacOS** and **Windows** + +| Arch | PHP Version | +|---------|-------------| +| `amd64` | `5.2`, `5.3`, `5.4`, `5.5`, `5.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2` | +| `arm64` | `5.3`, `5.4`, `5.5`, `5.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2` | diff --git a/doc/syncronize-file-permissions.md b/doc/syncronize-file-permissions.md new file mode 100644 index 0000000..99c3f7a --- /dev/null +++ b/doc/syncronize-file-permissions.md @@ -0,0 +1,89 @@ +Permissions | +[Tags](docker-tags.md) | +[Architectures](supported-architectures.md) | +[Versions](php-versions.md) | +[Flavours](flavours.md) | +[Extensions](php-modules.md) | +[Tools](available-tools.md) | +[Env Vars](docker-env-variables.md) | +[Volumes](docker-volumes.md) | +[Base Images](base-images.md) + +--- + +

Documentation

+ + + +### Motivation + +One main problem with a running Docker container is to **synchronize the ownership of files in a mounted volume** in order to preserve security (Not having to use `chmod 0777`). + + +### Unsynchronized permissions + +Consider the following directory structure of a mounted volume. Your hosts computer uid/gid are `1000` which does not have a corresponding user/group within the container. Fortunately the `tmp/` directory allows everybody to create new files in it. + +```shell + [Host] | [Container] +------------------------------------------------------------------------------------------ + $ ls -l | $ ls -l + -rw-r--r-- user group index.php | -rw-r--r-- 1000 1000 index.php + drwxrwxrwx user group tmp/ | drwxrwxrwx 1000 1000 tmp/ +``` + +Your web application might now have created some temporary files (via the PHP-FPM process) inside the `tmp/` directory: + +```shell + [Host] | [Container] +------------------------------------------------------------------------------------------ + $ ls -l tmp/ | $ ls -l tmp/ + -rw-r--r-- 96 96 _tmp_cache01.php | -rw-r--r-- www www _tmp_cache01.php + -rw-r--r-- 96 96 _tmp_cache02.php | -rw-r--r-- www www _tmp_cache01.php +``` + +On the Docker container side everything is still fine, but on your host computers side, those files now show a user id and group id of `96`, which is in fact the uid/gid of the PHP-FPM process running inside the container. On the host side you will now have to use `sudo` in order to delete/edit those files. + + +### It gets even worse + +Consider your had created the `tmp/` directory on your host only with `0775` permissions: + +```shell + [Host] | [Container] +------------------------------------------------------------------------------------------ + $ ls -l | $ ls -l + -rw-r--r-- user group index.php | -rw-r--r-- 1000 1000 index.php + drwxrwxr-x user group tmp/ | drwxrwxr-x 1000 1000 tmp/ +``` + +If your web application now wants to create some temporary files (via the PHP-FPM process) inside the `tmp/` directory, it will fail due to lacking permissions. + + +### The solution + +To overcome this problem, it must be made sure that the PHP-FPM process inside the container runs under the same uid/gid as your local user that mouns the volumes and also wants to work on those files locally. However, you never know during Image build time what user id this would be. Therefore it must be something that can be changed during startup of the container. + +This is achieved by two environment variables that can be provided during startup in order to change the uid/gid of the PHP-FPM user prior starting up PHP-FPM. + +```shell +$ docker run -e NEW_UID=1000 -e NEW_GID=1000 -it devilbox/php-fpm:7.2-base +[INFO] Changing user 'devilbox' uid to: 1000 +root $ usermod -u 1000 devilbox +[INFO] Changing group 'devilbox' gid to: 1000 +root $ groupmod -g 1000 devilbox +[INFO] Starting PHP 7.2.0 (fpm-fcgi) (built: Oct 30 2017 12:05:19) +``` + +When **`NEW_UID`** and **`NEW_GID`** are provided to the startup command, the container will do a `usermod` and `groupmod` prior starting up in order to assign new uid/gid to the PHP-FPM user. When the PHP-FPM process finally starts up it actually runs with your local system user and making sure permissions will be in sync from now on. + +At a minimum those two environment variables are offered by all flavours and types of the here provided PHP-FPM images. + +**Note:** + +To tackle this on the PHP-FPM side is only half a solution to the problem. The same applies to a web server Docker container when you offer **file uploads**. They will be uploaded and created by the web servers uid/gid. Therefore the web server itself must also provide the same kind of solution. See the following Web server Docker images for how this is done: + +**[Apache 2.2](https://github.com/devilbox/docker-apache-2.2)** | +**[Apache 2.4](https://github.com/devilbox/docker-apache-2.4)** | +**[Nginx stable](https://github.com/devilbox/docker-nginx-stable)** | +**[Nginx mainline](https://github.com/devilbox/docker-nginx-mainline)**