/docker-php-cli

Image with PHP 7.x, based on Alpine Linux with S6 overlay

Primary LanguageShellGNU General Public License v3.0GPL-3.0

docker-php-cli

Latest release Travis build status Docker build status Docker Hub downloads

A custom image with PHP, based on Alpine Linux with S6 overlay.

Versions

Image PHP Info
roeldev/php-cli:7.1-latest 7.1.28 mb-71-img
roeldev/php-cli:7.2-latest 7.2.17 mb-72-img
roeldev/php-cli:7.3-latest 7.3.4 mb-73-img
roeldev/php-cli:7.4-rc-latest 7.4.0alpha1 mb-74-img

Modules

Below is the result from php -m, a list of the modules that are installed by default:

Core libxml SimpleXML
ctype mbstring sodium
curl openssl SPL
date pcre standard
dom PDO tokenizer
fileinfo Phar xml
filter phpdb_webhelper xmlreader
hash posix xmlwriter
iconv readline zip
json Reflection zlib

Installing additional modules

It is possible to install additional modules when the container is initialized by setting the PHP_EXTENSIONS environment variable. Extension names should not include a php or release version and must be comma separated without trailing comma. Example: PHP_EXTENSIONS="sockets,yaml". See the links section for a list of extensions that can be installed from PHP.earth.

PHP configuration

The following php.ini directives are changed from their default values:

Name Value
expose_php off
date.timezone UTC

Installer scripts

The installer scripts within this container are meant as a starting point for usage in local development images or with Docker multi builds. Usage within production images is not recommended.

Install Composer

Run /usr/local/bin/install_composer.sh to download the official Composer install script. It is stored in /etc/composer/ together with the installer's signature. The install_composer.sh script will check if the signature matches and executes the installer. The Composer executable is moved to /usr/local/bin/ and is ready to be used.

Make sure to add /root/.composer/vendor/bin to your PATH if you'd like to make use of binaries from global packages.

Install devkit tools

After installing Composer it is possible to install some default devkit tools. Run /usr/local/bin/install_devkit.sh to globally install phploc, phpstan and phpcs.

Install Xdebug

Run /usr/local/bin/install_xdebug.sh to compile xdebug and install the module. It will then copy a default xdebug.ini config file to /config/php/xdebug.ini where you can change the settings to your needs.

Links

License

GPL-3.0+ © 2019 Roel Schut