From 45cfafc333513e71d34191c7ffc8608e1428a96f Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Wed, 11 Dec 2024 10:13:33 +0100 Subject: [PATCH] Add patches for Alpine/8.1 builds Co-authored-by: yosifkit --- 8.1/alpine3.20/cli/Dockerfile | 13 +++++++++++++ 8.1/alpine3.20/fpm/Dockerfile | 13 +++++++++++++ 8.1/alpine3.20/zts/Dockerfile | 13 +++++++++++++ 8.1/alpine3.21/cli/Dockerfile | 13 +++++++++++++ 8.1/alpine3.21/fpm/Dockerfile | 13 +++++++++++++ 8.1/alpine3.21/zts/Dockerfile | 13 +++++++++++++ Dockerfile-linux.template | 15 +++++++++++++++ 7 files changed, 93 insertions(+) diff --git a/8.1/alpine3.20/cli/Dockerfile b/8.1/alpine3.20/cli/Dockerfile index d5d1f25c0..23c077e60 100644 --- a/8.1/alpine3.20/cli/Dockerfile +++ b/8.1/alpine3.20/cli/Dockerfile @@ -100,6 +100,8 @@ RUN set -eux; \ linux-headers \ oniguruma-dev \ openssl-dev \ + patch \ + patchutils \ readline-dev \ sqlite-dev \ ; \ @@ -117,6 +119,17 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ +# Apply patches; see https://github.com/docker-library/php/pull/1552 + # https://github.com/php/php-src/issues/11678 + curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ + echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ + patch -p1 < 11678.patch; \ + rm 11678.patch; \ + # https://github.com/php/php-src/issues/14834 + curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ + echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ + rm 14834.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/8.1/alpine3.20/fpm/Dockerfile b/8.1/alpine3.20/fpm/Dockerfile index 846a3a724..8093d1145 100644 --- a/8.1/alpine3.20/fpm/Dockerfile +++ b/8.1/alpine3.20/fpm/Dockerfile @@ -100,6 +100,8 @@ RUN set -eux; \ linux-headers \ oniguruma-dev \ openssl-dev \ + patch \ + patchutils \ readline-dev \ sqlite-dev \ ; \ @@ -117,6 +119,17 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ +# Apply patches; see https://github.com/docker-library/php/pull/1552 + # https://github.com/php/php-src/issues/11678 + curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ + echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ + patch -p1 < 11678.patch; \ + rm 11678.patch; \ + # https://github.com/php/php-src/issues/14834 + curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ + echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ + rm 14834.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/8.1/alpine3.20/zts/Dockerfile b/8.1/alpine3.20/zts/Dockerfile index b48e30bcd..9efedf1a9 100644 --- a/8.1/alpine3.20/zts/Dockerfile +++ b/8.1/alpine3.20/zts/Dockerfile @@ -100,6 +100,8 @@ RUN set -eux; \ linux-headers \ oniguruma-dev \ openssl-dev \ + patch \ + patchutils \ readline-dev \ sqlite-dev \ ; \ @@ -117,6 +119,17 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ +# Apply patches; see https://github.com/docker-library/php/pull/1552 + # https://github.com/php/php-src/issues/11678 + curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ + echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ + patch -p1 < 11678.patch; \ + rm 11678.patch; \ + # https://github.com/php/php-src/issues/14834 + curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ + echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ + rm 14834.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/8.1/alpine3.21/cli/Dockerfile b/8.1/alpine3.21/cli/Dockerfile index 40ce7f5f2..755cd669d 100644 --- a/8.1/alpine3.21/cli/Dockerfile +++ b/8.1/alpine3.21/cli/Dockerfile @@ -100,6 +100,8 @@ RUN set -eux; \ linux-headers \ oniguruma-dev \ openssl-dev \ + patch \ + patchutils \ readline-dev \ sqlite-dev \ ; \ @@ -117,6 +119,17 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ +# Apply patches; see https://github.com/docker-library/php/pull/1552 + # https://github.com/php/php-src/issues/11678 + curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ + echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ + patch -p1 < 11678.patch; \ + rm 11678.patch; \ + # https://github.com/php/php-src/issues/14834 + curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ + echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ + rm 14834.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/8.1/alpine3.21/fpm/Dockerfile b/8.1/alpine3.21/fpm/Dockerfile index e162a57be..a496a7802 100644 --- a/8.1/alpine3.21/fpm/Dockerfile +++ b/8.1/alpine3.21/fpm/Dockerfile @@ -100,6 +100,8 @@ RUN set -eux; \ linux-headers \ oniguruma-dev \ openssl-dev \ + patch \ + patchutils \ readline-dev \ sqlite-dev \ ; \ @@ -117,6 +119,17 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ +# Apply patches; see https://github.com/docker-library/php/pull/1552 + # https://github.com/php/php-src/issues/11678 + curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ + echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ + patch -p1 < 11678.patch; \ + rm 11678.patch; \ + # https://github.com/php/php-src/issues/14834 + curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ + echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ + rm 14834.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/8.1/alpine3.21/zts/Dockerfile b/8.1/alpine3.21/zts/Dockerfile index 82ba7fdec..d69d8d91f 100644 --- a/8.1/alpine3.21/zts/Dockerfile +++ b/8.1/alpine3.21/zts/Dockerfile @@ -100,6 +100,8 @@ RUN set -eux; \ linux-headers \ oniguruma-dev \ openssl-dev \ + patch \ + patchutils \ readline-dev \ sqlite-dev \ ; \ @@ -117,6 +119,17 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ +# Apply patches; see https://github.com/docker-library/php/pull/1552 + # https://github.com/php/php-src/issues/11678 + curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ + echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ + patch -p1 < 11678.patch; \ + rm 11678.patch; \ + # https://github.com/php/php-src/issues/14834 + curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ + echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ + rm 14834.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index c1daa6cc7..4d423b8c1 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -261,6 +261,8 @@ RUN set -eux; \ "libsodium-dev", "libxml2-dev", "openssl-dev", + # https://github.com/docker-library/php/pull/1552 + if env.version | rtrimstr("-rc") == "8.1" then "patch", "patchutils" else empty end, "readline-dev", "sqlite-dev", # https://github.com/docker-library/php/issues/888 @@ -304,6 +306,19 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ +{{ if is_alpine and (env.version | rtrimstr("-rc") == "8.1") then ( -}} +# Apply patches; see https://github.com/docker-library/php/pull/1552 + # https://github.com/php/php-src/issues/11678 + curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ + echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ + patch -p1 < 11678.patch; \ + rm 11678.patch; \ + # https://github.com/php/php-src/issues/14834 + curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ + echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ + rm 14834.patch; \ +{{ ) else "" end -}} gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ {{ if is_alpine then "" else ( -}} debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \