Linux for PHP Docker images for continuous integration and running tests. These images can be used with GitLab CI, or any automated testing system or as standalone services.
5.6-nts, (5.6/Dockerfile)7.0-nts, (7.0/Dockerfile)7.1-nts, (7.1/Dockerfile)7.2-nts, (7.2/Dockerfile)7.3-nts, (7.3/Dockerfile)
These images are built from Linux for PHP official Docker images, and additionally include:
- All extensions are compiled and ready and loaded,
- PECL extensions: memcached, redis, mongodb, xdebug,
- sendmail command via msmtp, configured as relay to localhost. Check
/etc/msmtprcto setup relay server, - Git client,
- Composer,
- PHPUnit - latest stable version for php >= 5.6 and PHPUnit 4.8 for php < 5.6,
- PHP Code Sniffer - latest stable version of
phpcsandphpcbfcommands, - Node.js v10 from official Node.js repositories.
- Builds are based on the official Linux for PHP images (standard C toolchain).
- Automatically rebuilt when official images are updated, so this repository always contains the latest versions.
Check the Quick start guide
Check the Example projects
All major modules are enabled by default (compiled-in) and some are installed using PECL.
bcmath bz2 calendar ctype curl date dba dom ereg enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap libxml mbstring mcrypt mssql mysqli mysqlnd opcache openssl pcntl pcre pdo pdo_dblib pdo_mysql pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets spl sqlite3 standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib
memcached mongodb redis xdebug
For more information check the GitHub repository.
There are environment variables which can be passed to images on docker run.
-
WITHOUT_XDEBUG=1- disables xdebug extension, -
TIMEZONE=America/New_York- set system andphp.initimezone. You can also set timezone in .gitlab-ci.yml - check Example, -
COMPOSER_GITHUB=<YOUR_GITHUB_TOKEN>- Adds GitHub oauth token for Composer, which allows Composer to get unlimited repositories from Github without blocking non-interactive mode with request for authorization. You can obtain your token at https://github.com/settings/tokens.
-
How to set custom php.ini values
Easiest way is to mount your local
php.inion container start likedocker run ... -v /home/user/php.ini:/etc/php.ini ...