diff --git a/.travis.yml b/.travis.yml index 986e7b5..d05b92b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,9 @@ env: - VERSION=7.1 - VERSION=7.1-apache - VERSION=7.1-fpm + - VERSION=7.2 NO_DEV=1 + - VERSION=7.2-apache NO_DEV=1 + - VERSION=7.2-fpm NO_DEV=1 install: - travis_wait 30 make build VERSION=${VERSION} diff --git a/7.2/Dockerfile b/7.2/Dockerfile new file mode 100644 index 0000000..5a4c381 --- /dev/null +++ b/7.2/Dockerfile @@ -0,0 +1,37 @@ +FROM php:7.2 +MAINTAINER dev@chialab.it + +# Install PHP extensions and PECL modules. +RUN buildDeps=" \ + default-libmysqlclient-dev \ + libbz2-dev \ + libmemcached-dev \ + libsasl2-dev \ + " \ + runtimeDeps=" \ + curl \ + git \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmemcachedutil2 \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + " \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y $buildDeps $runtimeDeps \ + && docker-php-ext-install bcmath bz2 calendar iconv intl mbstring mysqli opcache pdo_mysql pdo_pgsql pgsql soap zip \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ + && docker-php-ext-install ldap \ + && pecl install memcached redis \ + && docker-php-ext-enable memcached.so redis.so \ + && apt-get purge -y --auto-remove $buildDeps \ + && rm -r /var/lib/apt/lists/* + +# Install Composer. +ENV COMPOSER_HOME /root/composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ENV PATH $COMPOSER_HOME/vendor/bin:$PATH diff --git a/7.2/apache/Dockerfile b/7.2/apache/Dockerfile new file mode 100644 index 0000000..58075d1 --- /dev/null +++ b/7.2/apache/Dockerfile @@ -0,0 +1,38 @@ +FROM php:7.2-apache +MAINTAINER dev@chialab.it + +# Install PHP extensions and PECL modules. +RUN buildDeps=" \ + default-libmysqlclient-dev \ + libbz2-dev \ + libmemcached-dev \ + libsasl2-dev \ + " \ + runtimeDeps=" \ + curl \ + git \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmemcachedutil2 \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + " \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y $buildDeps $runtimeDeps \ + && docker-php-ext-install bcmath bz2 calendar iconv intl mbstring mysqli opcache pdo_mysql pdo_pgsql pgsql soap zip \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ + && docker-php-ext-install ldap \ + && pecl install memcached redis \ + && docker-php-ext-enable memcached.so redis.so \ + && apt-get purge -y --auto-remove $buildDeps \ + && rm -r /var/lib/apt/lists/* \ + && a2enmod rewrite + +# Install Composer. +ENV COMPOSER_HOME /root/composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ENV PATH $COMPOSER_HOME/vendor/bin:$PATH diff --git a/7.2/fpm/Dockerfile b/7.2/fpm/Dockerfile new file mode 100644 index 0000000..67b0459 --- /dev/null +++ b/7.2/fpm/Dockerfile @@ -0,0 +1,37 @@ +FROM php:7.2-fpm +MAINTAINER dev@chialab.it + +# Install PHP extensions and PECL modules. +RUN buildDeps=" \ + default-libmysqlclient-dev \ + libbz2-dev \ + libmemcached-dev \ + libsasl2-dev \ + " \ + runtimeDeps=" \ + curl \ + git \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmemcachedutil2 \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + " \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y $buildDeps $runtimeDeps \ + && docker-php-ext-install bcmath bz2 calendar iconv intl mbstring mysqli opcache pdo_mysql pdo_pgsql pgsql soap zip \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ + && docker-php-ext-install ldap \ + && pecl install memcached redis \ + && docker-php-ext-enable memcached.so redis.so \ + && apt-get purge -y --auto-remove $buildDeps \ + && rm -r /var/lib/apt/lists/* + +# Install Composer. +ENV COMPOSER_HOME /root/composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ENV PATH $COMPOSER_HOME/vendor/bin:$PATH diff --git a/Dockerfile b/Dockerfile index 518383d..a610ec1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ MAINTAINER dev@chialab.it # Install PHP extensions and PECL modules. RUN buildDeps=" \ + default-libmysqlclient-dev \ libbz2-dev \ libmemcached-dev \ - libmysqlclient-dev \ libsasl2-dev \ " \ runtimeDeps=" \ @@ -15,14 +15,13 @@ RUN buildDeps=" \ libicu-dev \ libjpeg-dev \ libldap2-dev \ - libmcrypt-dev \ libmemcachedutil2 \ - libpng12-dev \ + libpng-dev \ libpq-dev \ libxml2-dev \ " \ && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y $buildDeps $runtimeDeps \ - && docker-php-ext-install bcmath bz2 calendar iconv intl mbstring mcrypt mysqli opcache pdo_mysql pdo_pgsql pgsql soap zip \ + && docker-php-ext-install bcmath bz2 calendar iconv intl mbstring mysqli opcache pdo_mysql pdo_pgsql pgsql soap zip \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install gd \ && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ diff --git a/Makefile b/Makefile index c88a78f..aa1f538 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ SHELL := /bin/bash PARENT_IMAGE := php IMAGE := chialab/php VERSION ?= latest +PHP_VERSION = $(firstword $(subst -, ,$(VERSION))) # Extensions. EXTENSIONS := \ @@ -15,7 +16,6 @@ EXTENSIONS := \ gd \ ldap \ mbstring \ - mcrypt \ memcached \ mysqli \ pdo_mysql \ @@ -24,13 +24,16 @@ EXTENSIONS := \ redis \ soap \ zip -ifneq ($(VERSION),$(filter 7.0 7.1 latest, $(VERSION))) +ifeq (,$(findstring $(PHP_VERSION), 7.2 latest)) + # Add more extensions to PHP < 7.2. + EXTENSIONS += mcrypt +endif +ifeq (,$(findstring $(PHP_VERSION), 7.0 7.1 7.2 latest)) # Add more extensions to 5.x series images. EXTENSIONS += mysql endif - -# add opcache check to php version with zend opcache -ifeq ($(VERSION),$(filter 5.5 5.6 7.0 7.1 latest, $(VERSION))) +ifneq (,$(findstring $(PHP_VERSION), 5.5 5.6 7.0 7.1 7.2 latest)) + # Add OPCache check to PHP version with Zend OPCache. EXTENSIONS += OPcache endif diff --git a/README.md b/README.md index 8733323..5dd7bc0 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ For development environments, you might want to choose an [image with XDebug ins - [`7.1` (_7.1/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/7.1/Dockerfile) - [`7.1-apache` (_7.1/apache/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/7.1/apache/Dockerfile) - [`7.1-fpm` (_7.1/fpm/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/7.1/fpm/Dockerfile) +- [`7.2` (_7.2/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/7.2/Dockerfile) +- [`7.2-apache` (_7.2/apache/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/7.2/apache/Dockerfile) +- [`7.2-fpm` (_7.2/fpm/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/7.2/fpm/Dockerfile) As you might have guessed, all tags are built on top of the corresponding tag of the official image. Not all tags are supported in order to easen manteinance. diff --git a/dev/Dockerfile b/dev/Dockerfile index d857037..2401477 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -1,4 +1,4 @@ -FROM chialab/php:latest +FROM chialab/php:7.1 MAINTAINER dev@chialab.it # Install XDebug. diff --git a/dev/Makefile b/dev/Makefile index 30a7612..5c8be7f 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -4,6 +4,7 @@ SHELL := /bin/bash PARENT_IMAGE := chialab/php IMAGE := chialab/php-dev VERSION ?= latest +PHP_VERSION = $(firstword $(subst -, ,$(VERSION))) # Extensions. EXTENSIONS := \ @@ -15,7 +16,6 @@ EXTENSIONS := \ gd \ ldap \ mbstring \ - mcrypt \ memcached \ mysqli \ pdo_mysql \ @@ -25,13 +25,12 @@ EXTENSIONS := \ soap \ Xdebug \ zip -ifneq ($(VERSION),$(filter 7.0 7.1 latest, $(VERSION))) +ifeq (,$(findstring $(PHP_VERSION), 7.0 7.1 7.2 latest)) # Add more extensions to 5.x series images. EXTENSIONS += mysql endif - -# add opcache check to php version with zend opcache -ifeq ($(VERSION),$(filter 5.5 5.6 7.0 7.1 latest, $(VERSION))) +ifneq (,$(findstring $(PHP_VERSION), 5.5 5.6 7.0 7.1 7.2 latest)) + # Add OPCache check to PHP version with Zend OPCache. EXTENSIONS += OPcache endif diff --git a/dev/README.md b/dev/README.md index 8ff88c9..d97f59d 100644 --- a/dev/README.md +++ b/dev/README.md @@ -10,6 +10,7 @@ For more production-like environments, you might want to choose an [image *witho ## Available tags and `Dockerfile` links - [`latest` (_dev/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/dev/Dockerfile) + (**NOTE**: this is actually built on top of PHP 7.1 as XDebug is not yet available for PHP 7.2!) - [`5.5` (_dev/5.5/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/dev/5.5/Dockerfile) - [`5.5-apache` (_dev/5.5/apache/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/dev/5.5/apache/Dockerfile) - [`5.5-fpm` (_dev/5.5/fpm/Dockerfile_)](https://github.com/Chialab/docker-php/blob/master/dev/5.5/fpm/Dockerfile)