1 Commits

Author SHA1 Message Date
Hans Rakers
a4a5333889 install Zend Opcache by default 2020-10-09 13:42:41 +02:00
2 changed files with 22 additions and 13 deletions

View File

@@ -156,16 +156,16 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
# Install MySQL 5.7 client library and headers (the system package is compiled against OpenSSL 1.1, which we can't use)
cd /usr/src; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb" -o libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb.asc" -o libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb.asc; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb" -o libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb.asc" -o libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb.asc; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/mysql-common_5.7.36-1ubuntu18.04_amd64.deb" -o mysql-common_5.7.36-1ubuntu18.04_amd64.deb; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/mysql-common_5.7.36-1ubuntu18.04_amd64.deb.asc" -o mysql-common_5.7.36-1ubuntu18.04_amd64.deb.asc; \
gpg --verify libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb.asc; \
gpg --verify libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb.asc; \
gpg --verify mysql-common_5.7.36-1ubuntu18.04_amd64.deb.asc; \
dpkg -i libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb mysql-common_5.7.36-1ubuntu18.04_amd64.deb; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient-dev_5.7.30-1ubuntu18.04_amd64.deb" -o libmysqlclient-dev_5.7.30-1ubuntu18.04_amd64.deb; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient-dev_5.7.30-1ubuntu18.04_amd64.deb.asc" -o libmysqlclient-dev_5.7.30-1ubuntu18.04_amd64.deb.asc; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb" -o libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb.asc" -o libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb.asc; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/mysql-common_5.7.30-1ubuntu18.04_amd64.deb" -o mysql-common_5.7.30-1ubuntu18.04_amd64.deb; \
curl -SL "http://mirror.nl.leaseweb.net/mysql/Downloads/MySQL-5.7/mysql-common_5.7.30-1ubuntu18.04_amd64.deb.asc" -o mysql-common_5.7.30-1ubuntu18.04_amd64.deb.asc; \
gpg --verify libmysqlclient-dev_5.7.30-1ubuntu18.04_amd64.deb.asc; \
gpg --verify libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb.asc; \
gpg --verify mysql-common_5.7.30-1ubuntu18.04_amd64.deb.asc; \
dpkg -i libmysqlclient-dev_5.7.30-1ubuntu18.04_amd64.deb libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb mysql-common_5.7.30-1ubuntu18.04_amd64.deb; \
curl -SL "http://nl.php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o php.tar.xz; \
curl -SL "http://nl.php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o php.tar.xz.asc; \
# This patch removes the GLOB_NOSORT flag from the glob() call in sapi/fpm/fpm/fpm_conf.c
@@ -256,7 +256,7 @@ RUN set -eux; \
; \
# Install MySQL 5.7 client library and headers (the system package is compiled against OpenSSL 1.1)
cd /usr/src; \
dpkg -i libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb mysql-common_5.7.36-1ubuntu18.04_amd64.deb; \
dpkg -i libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb mysql-common_5.7.30-1ubuntu18.04_amd64.deb; \
rm /usr/src/*amd64.deb*; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
@@ -279,6 +279,11 @@ RUN set -eux; \
cd /; \
docker-php-source delete; \
pecl update-channels; \
# This solves the "not a valid package archive" errors
pear upgrade -Z Archive_Tar; \
# Install Zend Opcache
pecl install zendopcache; \
docker-php-ext-enable opcache; \
rm -rf /tmp/pear ~/.pearrc; \
php --version

View File

@@ -17,10 +17,14 @@ See the [README](https://github.com/docker-library/docs/blob/master/php/README.m
## Differences with the original image
There are two deviations from the original image. This image contains a backported patch to fpm that changes the order in which configuration files are included from `/usr/local/etc/php-fpm.d`. By default in PHP 5.3 there was no sorting on the glob, causing files to be included in whatever order they appeared in the filesystem, which can differ from system to system. The patch removes the `GLOB_NOSORT` from the call to glob(), causing the files to be included in a alphabetic order. See [Dockerfile](Dockerfile) for details.
There are three deviations from the original image.
This image also allows you to override the default listen directive of fpm. By default, it will listen on `0.0.0.0:9000`, but you can override this using the environment variable `PHP_FPM_LISTEN`. For example:
* This image contains a backported patch to fpm that changes the order in which configuration files are included from `/usr/local/etc/php-fpm.d`. By default in PHP 5.3 there was no sorting on the glob, causing files to be included in whatever order they appeared in the filesystem, which can differ from system to system. The patch removes the `GLOB_NOSORT` from the call to glob(), causing the files to be included in a alphabetic order. See [Dockerfile](Dockerfile) for details.
* This image also allows you to override the default listen directive of fpm. By default, it will listen on `0.0.0.0:9000`, but you can override this using the environment variable `PHP_FPM_LISTEN`. For example:
```
docker run -it -e PHP_FPM_LISTEN="localhost:9000" hrak/php-5.3:latest
```
* Zend Opcache is included (extension load, but not enabled by default). You can enable and configure it through php.ini