Convenient Php image with extensions
This image is designed for convenient development. Store PHP configs in your application CVS and mount to a container.
Added commonly used PHP extensions and libraries to official PHP-fpm images.
Small disk size thanks to alpine linux.
mkdir etc docker run --rm -d -v c:\\www\\etc:/usr/local/etc grikdotnet/php:7.1-fpm-alpine ... edit configs docker-compose up
Assuming your document root folder is called wwroot\ and is located in your application folder.
- Create a local "etc" folder within your project
- Start a container with etc folder mounted, php configs will appear in a mounted folder
- Edit php.ini and fpm configs, enable or disable extensions by renaming files in etc/php/conf.d
- Restart the php-extensions container
- Commit php configs to the project VCS
If you use docker in Linux for development, it is convenient to have the user and group ID inside a docker container synchronized with the user and group ID in your system. Check www-data id in your system, and add yourself to the www-data group.
$ id www-data uid=82(www-data) gid=82(www-data) groups=82(www-data),82(www-data) $ sudo usermod -a -G www-data $(whoami)
The value is hard-coded by official image maintainers. It can be changed by extending the image.
List of extensions and dependent libraries added to the official PHP image.
In :5.6-fpm-alpine and :7.1-fpm-alpine :
- GD, with webp support in php 7
- igbinary - a serializer for redis and memcached
- memcached, configured with igbinary serializer and sessions support
- Redis with and sessions support and igbinary seralizer
- Xdebug (disabled)
- Zend OPcache enabled
- Latest ImageMagick executable, library and PHP extension
- WEBP support - an efficient image format for web
- FLIF support - new efficient lossless image format
- 104 MB for PHP 5.6
- 118 MB for PHP 7.1
- 175 MB for PHP 7.1 with ImageMagic