forked from gh-mirrors/docker-php-5.3
Compare commits
7 Commits
HRA/mysql_
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 46d3e5c96c | |||
| 7853e58472 | |||
| 2473d7a124 | |||
| a53115cef6 | |||
| 3315a836f1 | |||
| b128e1b4f7 | |||
|
|
d1d85d599e |
104
Dockerfile
104
Dockerfile
@@ -20,10 +20,10 @@ RUN set -eux; \
|
|||||||
apt-get clean; \
|
apt-get clean; \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN set -eux; \
|
# RUN set -eux; \
|
||||||
mkdir ~/.gnupg; \
|
# mkdir ~/.gnupg; \
|
||||||
echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
|
# echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
|
||||||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0E604491
|
# gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0E604491
|
||||||
|
|
||||||
# compile openssl, otherwise --with-openssl won't work
|
# compile openssl, otherwise --with-openssl won't work
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
@@ -32,7 +32,7 @@ RUN set -eux; \
|
|||||||
mkdir openssl; \
|
mkdir openssl; \
|
||||||
curl -sL "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz; \
|
curl -sL "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz; \
|
||||||
curl -sL "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc; \
|
curl -sL "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc; \
|
||||||
gpg --verify openssl.tar.gz.asc; \
|
# gpg --verify openssl.tar.gz.asc; \
|
||||||
tar -xzf openssl.tar.gz -C openssl --strip-components=1; \
|
tar -xzf openssl.tar.gz -C openssl --strip-components=1; \
|
||||||
cd /tmp/openssl; \
|
cd /tmp/openssl; \
|
||||||
./config no-ssl2 no-ssl3 zlib-dynamic -fPIC && make -j$(nproc) && make install_sw; \
|
./config no-ssl2 no-ssl3 zlib-dynamic -fPIC && make -j$(nproc) && make install_sw; \
|
||||||
@@ -64,10 +64,10 @@ RUN set -eux; \
|
|||||||
apt-get clean; \
|
apt-get clean; \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN set -eux; \
|
# RUN set -eux; \
|
||||||
mkdir ~/.gnupg; \
|
# mkdir ~/.gnupg; \
|
||||||
echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
|
# echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
|
||||||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 5CC908FDB71E12C2
|
# gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 5CC908FDB71E12C2
|
||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
CURL_VERSION="7.71.1"; \
|
CURL_VERSION="7.71.1"; \
|
||||||
@@ -75,7 +75,7 @@ RUN set -eux; \
|
|||||||
mkdir curl; \
|
mkdir curl; \
|
||||||
curl -sL "https://curl.haxx.se/download/curl-$CURL_VERSION.tar.gz" -o curl.tar.gz; \
|
curl -sL "https://curl.haxx.se/download/curl-$CURL_VERSION.tar.gz" -o curl.tar.gz; \
|
||||||
curl -sL "https://curl.haxx.se/download/curl-$CURL_VERSION.tar.gz.asc" -o curl.tar.gz.asc; \
|
curl -sL "https://curl.haxx.se/download/curl-$CURL_VERSION.tar.gz.asc" -o curl.tar.gz.asc; \
|
||||||
gpg --verify curl.tar.gz.asc; \
|
# gpg --verify curl.tar.gz.asc; \
|
||||||
tar -xzf curl.tar.gz -C curl --strip-components=1; \
|
tar -xzf curl.tar.gz -C curl --strip-components=1; \
|
||||||
cd /tmp/curl; \
|
cd /tmp/curl; \
|
||||||
./configure --prefix=/usr/local/curl --disable-shared --enable-static --disable-dependency-tracking \
|
./configure --prefix=/usr/local/curl --disable-shared --enable-static --disable-dependency-tracking \
|
||||||
@@ -129,12 +129,12 @@ RUN set -eux; \
|
|||||||
|
|
||||||
ENV PHP_INI_DIR /usr/local/etc/php
|
ENV PHP_INI_DIR /usr/local/etc/php
|
||||||
|
|
||||||
ENV GPG_KEYS 0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7 A4A9406876FCBD3C456770C88C718D3B5072E1F5
|
# ENV GPG_KEYS 0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7 A4A9406876FCBD3C456770C88C718D3B5072E1F5
|
||||||
RUN set -xe \
|
# RUN set -xe \
|
||||||
&& mkdir ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf \
|
# && mkdir ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf \
|
||||||
&& for key in $GPG_KEYS; do \
|
# && for key in $GPG_KEYS; do \
|
||||||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
|
# gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
|
||||||
done
|
# done
|
||||||
|
|
||||||
ENV PHP_VERSION 5.3.29
|
ENV PHP_VERSION 5.3.29
|
||||||
|
|
||||||
@@ -156,22 +156,22 @@ COPY docker-php-source /usr/local/bin/
|
|||||||
RUN set -eux; \
|
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)
|
# 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; \
|
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://mirrors.huaweicloud.com/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://mirrors.huaweicloud.com/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://mirrors.huaweicloud.com/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://mirrors.huaweicloud.com/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://mirrors.huaweicloud.com/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; \
|
curl -SL "http://mirrors.huaweicloud.com/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 libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb.asc; \
|
||||||
gpg --verify libmysqlclient20_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; \
|
# 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; \
|
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://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/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; \
|
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
|
# This patch removes the GLOB_NOSORT flag from the glob() call in sapi/fpm/fpm/fpm_conf.c
|
||||||
# Without this, the read order of fpm config files is completely random. See https://bugs.php.net/bug.php?id=68391
|
# Without this, the read order of fpm config files is completely random. See https://bugs.php.net/bug.php?id=68391
|
||||||
curl -SL "https://github.com/php/php-src/commit/29d2c13809247dfd21b1f20d1d3771e10590694e.diff" -o fpm_conf_glob_sort.patch; \
|
curl -SL "https://github.com/php/php-src/commit/29d2c13809247dfd21b1f20d1d3771e10590694e.diff" -o fpm_conf_glob_sort.patch; \
|
||||||
gpg --verify php.tar.xz.asc; \
|
# gpg --verify php.tar.xz.asc; \
|
||||||
docker-php-source extract; \
|
docker-php-source extract; \
|
||||||
cd /usr/src/php; \
|
cd /usr/src/php; \
|
||||||
export \
|
export \
|
||||||
@@ -321,6 +321,58 @@ RUN set -eux; \
|
|||||||
echo 'listen = ${PHP_FPM_LISTEN}'; \
|
echo 'listen = ${PHP_FPM_LISTEN}'; \
|
||||||
} | tee php-fpm.d/zz-docker.conf
|
} | tee php-fpm.d/zz-docker.conf
|
||||||
|
|
||||||
|
RUN set -eux; \
|
||||||
|
{ \
|
||||||
|
echo '[Core]'; \
|
||||||
|
echo 'log_errors="On"'; \
|
||||||
|
echo 'error_log=/proc/self/fd/2'; \
|
||||||
|
echo 'date.timezone=Asia/Bangkok'; \
|
||||||
|
} | tee /usr/local/etc/php/conf.d/core.ini;
|
||||||
|
|
||||||
|
# install php-memcached
|
||||||
|
RUN set -eux; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libmemcached-dev \
|
||||||
|
libz-dev \
|
||||||
|
; \
|
||||||
|
apt-get clean; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN set -eux; \
|
||||||
|
cd /tmp; \
|
||||||
|
curl -JLO https://github.com/php-memcached-dev/php-memcached/archive/refs/tags/2.2.0.tar.gz; \
|
||||||
|
tar xpf php-memcached-2.2.0.tar.gz; \
|
||||||
|
cd php-memcached-2.2.0; \
|
||||||
|
phpize; \
|
||||||
|
./configure; \
|
||||||
|
make install; \
|
||||||
|
cd /tmp; \
|
||||||
|
rm -rf php-memcached-2.2.0.tar.gz php-memcached-2.2.0
|
||||||
|
|
||||||
|
RUN set -eux; \
|
||||||
|
{ \
|
||||||
|
echo 'extension=memcached.so'; \
|
||||||
|
} | tee /usr/local/etc/php/conf.d/memcached.ini;
|
||||||
|
# install phpredis
|
||||||
|
RUN set -eux; \
|
||||||
|
PHPREDIS_VERSION="2.2.8"; \
|
||||||
|
cd /tmp; \
|
||||||
|
mkdir phpredis; \
|
||||||
|
curl -sL "https://pecl.php.net/get/redis-${PHPREDIS_VERSION}.tgz" -o phpredis.tar.gz; \
|
||||||
|
tar -xzf phpredis.tar.gz -C phpredis --strip-components=1; \
|
||||||
|
cd /tmp/phpredis; \
|
||||||
|
phpize; \
|
||||||
|
./configure; \
|
||||||
|
make install; \
|
||||||
|
rm -rf /tmp/*
|
||||||
|
RUN set -eux; \
|
||||||
|
{ \
|
||||||
|
echo 'extension=redis.so'; \
|
||||||
|
echo 'session.save_handler = redis'; \
|
||||||
|
echo 'session.save_path = "tcp://valkey:6379"'; \
|
||||||
|
} | tee /usr/local/etc/php/conf.d/redis.ini;
|
||||||
|
|
||||||
# Override stop signal to stop process gracefully
|
# Override stop signal to stop process gracefully
|
||||||
# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163
|
# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163
|
||||||
STOPSIGNAL SIGQUIT
|
STOPSIGNAL SIGQUIT
|
||||||
|
|||||||
Reference in New Issue
Block a user