9 Commits

Author SHA1 Message Date
46d3e5c96c Add memcached extension 2025-04-13 16:49:09 +07:00
7853e58472 Actually enable redis extension 2025-04-13 16:48:36 +07:00
2473d7a124 Add phpredis 2025-04-13 16:10:01 +07:00
a53115cef6 Add minimal PHP settings to shut to warnings 2024-11-23 13:09:34 +07:00
3315a836f1 Find a mirror for mysql-5.7 that is still not dead 2024-11-23 13:08:58 +07:00
b128e1b4f7 Skip GPG stuff for now
This is an old dockerfile for an old PHP version using old versions of
dependencies. Some links to GPG signatures are dead, some keys are
expired. It needs to be fixed somewhere down the road.
2024-11-23 13:07:20 +07:00
Hans Rakers
d1d85d599e Merge pull request #6 from hrak/HRA/mysql_5_7_33
Bump mysql packages to 5.7.36
2021-11-16 21:22:12 +01:00
Hans Rakers
b03c24a7ad Bump mysql packages to 5.7.36 2021-11-01 16:48:41 +01:00
Hans Rakers
a8ee3643b1 Bump mysql packages to 5.7.33 2021-01-18 09:46:19 +01:00

View File

@@ -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.30-1ubuntu18.04_amd64.deb" -o libmysqlclient-dev_5.7.30-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.30-1ubuntu18.04_amd64.deb.asc" -o libmysqlclient-dev_5.7.30-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.30-1ubuntu18.04_amd64.deb" -o libmysqlclient20_5.7.30-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.30-1ubuntu18.04_amd64.deb.asc" -o libmysqlclient20_5.7.30-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.30-1ubuntu18.04_amd64.deb" -o mysql-common_5.7.30-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.30-1ubuntu18.04_amd64.deb.asc" -o mysql-common_5.7.30-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.30-1ubuntu18.04_amd64.deb.asc; \ # gpg --verify libmysqlclient-dev_5.7.36-1ubuntu18.04_amd64.deb.asc; \
gpg --verify libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb.asc; \ # gpg --verify libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb.asc; \
gpg --verify mysql-common_5.7.30-1ubuntu18.04_amd64.deb.asc; \ # gpg --verify mysql-common_5.7.36-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; \ 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 \
@@ -256,7 +256,7 @@ RUN set -eux; \
; \ ; \
# Install MySQL 5.7 client library and headers (the system package is compiled against OpenSSL 1.1) # Install MySQL 5.7 client library and headers (the system package is compiled against OpenSSL 1.1)
cd /usr/src; \ cd /usr/src; \
dpkg -i libmysqlclient20_5.7.30-1ubuntu18.04_amd64.deb mysql-common_5.7.30-1ubuntu18.04_amd64.deb; \ dpkg -i libmysqlclient20_5.7.36-1ubuntu18.04_amd64.deb mysql-common_5.7.36-1ubuntu18.04_amd64.deb; \
rm /usr/src/*amd64.deb*; \ rm /usr/src/*amd64.deb*; \
apt-get clean; \ apt-get clean; \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
@@ -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