Skip to content

Add Alpine 3.22 (remove Alpine 3.20) #1580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion 8.2/alpine3.20/zts/Dockerfile → 8.2/alpine3.22/zts/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion 8.3/alpine3.20/zts/Dockerfile → 8.3/alpine3.22/zts/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion 8.4/alpine3.20/zts/Dockerfile → 8.4/alpine3.22/zts/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 44 additions & 7 deletions Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@
;
def is_alpine:
env.from | startswith("alpine")
;
def rcVersion:
env.version | rtrimstr("-rc")
;
def need_patch_11678:
# https://github.com/docker-library/php/pull/1552
# https://github.com/php/php-src/issues/11678 "Build fails on musl 1.2.4 - lfs64" stream_cookie_seeker
# https://github.com/php/php-src/issues/14834 "Error installing PHP when --with-pear is used" xml errors
is_alpine and rcVersion == "8.1"
;
def need_patch_18743:
# https://github.com/docker-library/php/pull/1580
# https://github.com/php/php-src/issues/18743 "Incompatibility in Inline TLS Assembly on Alpine 3.22 with zend_jit_ir.c"
env.variant == "zts" # only needed for ZTS builds
and is_alpine
and (env.from != "alpine:3.21") # only needed for Alpine 3.22+
and (
IN(rcVersion; "8.1", "8.2")
or IN(.version; "8.3.22", "8.4.8") # https://github.com/docker-library/php/pull/1580#issuecomment-2955259172
)
-}}
FROM {{ env.from }}

Expand Down Expand Up @@ -190,7 +210,7 @@ ENV GPG_KEYS {{
"39B6 4134 3D8C 104B 2B14 6DC3 F9C3 9DC0 B969 8544", # ramsey
"F1F6 9223 8FBC 1666 E5A5 CCD4 199F 9DFE F6FF BAFD" # patrickallaert
],
}[env.version | rtrimstr("-rc")] // error("missing GPG keys for " + env.version)
}[rcVersion] // error("missing GPG keys for " + rcVersion)
| map(gsub(" "; ""))
| join(" ")
}}
Expand Down Expand Up @@ -261,8 +281,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,
# https://github.com/docker-library/php/pull/1552 (11678) & https://github.com/docker-library/php/pull/1580 (14834)
if need_patch_11678 or need_patch_18743 then "patch", "patchutils" else empty end,
"readline-dev",
"sqlite-dev",
# https://github.com/docker-library/php/issues/888
Expand Down Expand Up @@ -306,7 +326,7 @@ RUN set -eux; \
; \
docker-php-source extract; \
cd /usr/src/php; \
{{ if is_alpine and (env.version | rtrimstr("-rc") == "8.1") then ( -}}
{{ if need_patch_11678 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; \
Expand All @@ -318,6 +338,23 @@ RUN set -eux; \
echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \
filterdiff -x '*/NEWS' 14834.patch | patch -p1; \
rm 14834.patch; \
{{ ) else "" end -}}
{{
if need_patch_18743 then
# https://github.com/docker-library/php/pull/1580#issuecomment-2957191901
{
"8.1": { url: "https://github.com/php/php-src/commit/f171d5f8a203b8f1b0c1e6620acfbaf625aa91c0.patch?full_index=1", sha256: "d782380d07e9fb99872e4c84653eea7ff0395e4ad58de93b8673f065a0f46c84" },
"8.4": { url: "https://github.com/php/php-src/commit/4c7220322bc74b0fc8416e1958cadd7bc51fe1b7.diff?full_index=1", sha256: "a19e795b24c52d4d1aa3d45b67339e1b62a5365b37cf4418b83e2709fc98bcb5" },
}[rcVersion]
// { url: "https://github.com/php/php-src/commit/b3c8afe272a6919248986c703c2e1defc73ff707.patch?full_index=1", sha256: "b334f73434c9732a4b27a42eb5d417e10df842e854c02a3e753b2479f8978bf5" }
| (
-}}
# https://github.com/php/php-src/issues/18743 "Incompatibility in Inline TLS Assembly on Alpine 3.22 with zend_jit_ir.c"
# https://github.com/docker-library/php/pull/1580
curl -fL {{ .url | @sh }} -o 18743.patch; \
echo {{ "\(.sha256) *18743.patch" | @sh }} | sha256sum -c -; \
filterdiff -x '*/NEWS' 18743.patch | patch -p1; \
rm 18743.patch; \
{{ ) else "" end -}}
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
{{ if is_alpine then "" else ( -}}
Expand All @@ -341,7 +378,7 @@ RUN set -eux; \
# https://github.com/docker-library/php/issues/822
--with-pic \
\
{{ if env.version | rtrimstr("-rc") == "8.1" then ( -}}
{{ if rcVersion == "8.1" then ( -}}
# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236).
--enable-ftp \
{{ ) else "" end -}}
Expand Down Expand Up @@ -375,7 +412,7 @@ RUN set -eux; \
# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
--with-pear \
\
{{ if env.version | rtrimstr("-rc") | IN("8.1", "8.2") then ( -}}
{{ if rcVersion | IN("8.1", "8.2") then ( -}}
# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+)
# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c
# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib
Expand Down Expand Up @@ -412,7 +449,7 @@ RUN set -eux; \
--enable-zts \
# https://externals.io/message/118859
--disable-zend-signals \
{{ if env.version | rtrimstr("-rc") | IN("8.1", "8.2") then ( -}}
{{ if rcVersion | IN("8.1", "8.2") then ( -}}
--enable-zend-max-execution-timers \
{{ ) else "" end -}}
{{ ) else "" end -}}
Expand Down
32 changes: 16 additions & 16 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"bullseye/apache",
"bullseye/fpm",
"bullseye/zts",
"alpine3.22/cli",
"alpine3.22/fpm",
"alpine3.22/zts",
"alpine3.21/cli",
"alpine3.21/fpm",
"alpine3.21/zts",
"alpine3.20/cli",
"alpine3.20/fpm",
"alpine3.20/zts"
"alpine3.21/zts"
]
},
"8.1-rc": null,
Expand All @@ -36,12 +36,12 @@
"bullseye/apache",
"bullseye/fpm",
"bullseye/zts",
"alpine3.22/cli",
"alpine3.22/fpm",
"alpine3.22/zts",
"alpine3.21/cli",
"alpine3.21/fpm",
"alpine3.21/zts",
"alpine3.20/cli",
"alpine3.20/fpm",
"alpine3.20/zts"
"alpine3.21/zts"
]
},
"8.2-rc": null,
Expand All @@ -59,12 +59,12 @@
"bullseye/apache",
"bullseye/fpm",
"bullseye/zts",
"alpine3.22/cli",
"alpine3.22/fpm",
"alpine3.22/zts",
"alpine3.21/cli",
"alpine3.21/fpm",
"alpine3.21/zts",
"alpine3.20/cli",
"alpine3.20/fpm",
"alpine3.20/zts"
"alpine3.21/zts"
]
},
"8.3-rc": null,
Expand All @@ -82,12 +82,12 @@
"bullseye/apache",
"bullseye/fpm",
"bullseye/zts",
"alpine3.22/cli",
"alpine3.22/fpm",
"alpine3.22/zts",
"alpine3.21/cli",
"alpine3.21/fpm",
"alpine3.21/zts",
"alpine3.20/cli",
"alpine3.20/fpm",
"alpine3.20/zts"
"alpine3.21/zts"
]
},
"8.4-rc": null
Expand Down
2 changes: 1 addition & 1 deletion versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ for version in "${versions[@]}"; do
for suite in \
bookworm \
bullseye \
alpine3.22 \
alpine3.21 \
alpine3.20 \
; do
for variant in cli apache fpm zts; do
if [[ "$suite" = alpine* ]]; then
Expand Down