From 519af32b2b50e65fb7c2b8696091cd1753ca3546 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Thu, 12 Nov 2026 23:29:52 +0530 Subject: [PATCH 01/21] Inline bases into active runtime Dockerfiles Fold the common and platform-specific bases into the existing runtime recipes, preserving OS profiles and runtime instructions. Keep version inputs in images/constants.yml and document direct runtime builds. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 8 + images/runtime/node/20/bookworm.Dockerfile | 112 ++++++++++++- images/runtime/node/20/bullseye.Dockerfile | 112 ++++++++++++- images/runtime/node/22/bookworm.Dockerfile | 112 ++++++++++++- images/runtime/node/22/bullseye.Dockerfile | 112 ++++++++++++- images/runtime/node/24/noble.Dockerfile | 112 ++++++++++++- images/runtime/node/26/resolute.Dockerfile | 58 ++++++- images/runtime/node/README.md | 35 ++-- .../runtime/php-fpm/8.1/bullseye.Dockerfile | 155 ++++++++++++++++- .../runtime/php-fpm/8.2/bookworm.Dockerfile | 155 ++++++++++++++++- .../runtime/php-fpm/8.2/bullseye.Dockerfile | 155 ++++++++++++++++- .../runtime/php-fpm/8.3/bookworm.Dockerfile | 156 +++++++++++++++++- .../runtime/php-fpm/8.3/bullseye.Dockerfile | 155 ++++++++++++++++- .../runtime/php-fpm/8.4/bookworm.Dockerfile | 156 +++++++++++++++++- .../runtime/php-fpm/8.4/bullseye.Dockerfile | 155 ++++++++++++++++- images/runtime/php-fpm/8.5/noble.Dockerfile | 156 +++++++++++++++++- images/runtime/php/8.2/bullseye.Dockerfile | 152 ++++++++++++++++- images/runtime/php/8.3/bookworm.Dockerfile | 152 ++++++++++++++++- images/runtime/python/noble.Dockerfile | 82 ++++++++- .../python/resolute-based/resolute.Dockerfile | 59 ++++++- images/runtime/python/template.Dockerfile | 85 +++++++++- 21 files changed, 2361 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 7488fed6bb..8395255909 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,14 @@ docker run --detach --rm \ Oryx consists of a build image, a collection of runtime images, a build script generator, and a collection of startup script generators. For more details, refer to our [architecture](./doc/architecture.md) page. +The active Node, Python, and PHP runtime Dockerfiles include the common and +platform-specific bases as stages in the same file. Build them directly from +the repository root with exact version inputs from `images/constants.yml`; +separately built `BASE_IMAGE` inputs are no longer required. The .NET runtime +Dockerfiles were already self-contained. Python's shared Debian recipe still +selects its OS using `DEBIAN_FLAVOR`, and disposable compiler stages remain +part of the runtime build. + # Testing Locally ## startup script generator `build/testStartupScriptGenerators.sh` will perform tests on all startup script generators written in go. diff --git a/images/runtime/node/20/bookworm.Dockerfile b/images/runtime/node/20/bookworm.Dockerfile index 4967242350..3206aefb6f 100644 --- a/images/runtime/node/20/bookworm.Dockerfile +++ b/images/runtime/node/20/bookworm.Dockerfile @@ -1,4 +1,109 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bookworm +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base +ARG IMAGES_DIR=/tmp/oryx/images + +RUN apt-get update \ + && apt-get install -y \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +# NOTE: This is a list of keys for ALL Node versions and also Yarn package installs. +# Receiving them once speeds up building of individual node versions as they all derive +# from this image. + +# Gpg keys listed at https://github.com/nodejs/node + +RUN ${IMAGES_DIR}/receiveGpgKeys.sh \ + 6A010C5166006599AA17F08146C2130DFD2497F5 + +ARG YARN_VERSION +ENV YARN_VERSION ${YARN_VERSION} + +COPY images/yarn-v${YARN_VERSION}.tar.gz . + +RUN mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -15,7 +120,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh node /opt/startupcmdgen/startupcmdgen # Download Node.js directly from official source -FROM ${BASE_IMAGE} AS nodeDownloader +FROM oryx_runtime_base AS nodeDownloader ARG NODE20_VERSION WORKDIR /tmp/node-download RUN apt-get update \ @@ -31,8 +136,7 @@ RUN apt-get update \ && tar -xJf "node-v${NODE20_VERSION}-linux-x64.tar.xz" -C /opt/nodejs --strip-components=1 \ && rm -rf /tmp/node-download -#FROM oryxdevmcr.azurecr.io/private/oryx/oryx-node-run-base-bookworm:${BUILD_NUMBER} -FROM ${BASE_IMAGE} +FROM oryx_runtime_base RUN groupadd --gid 1000 node \ && useradd --uid 1000 --gid node --shell /bin/bash --create-home node diff --git a/images/runtime/node/20/bullseye.Dockerfile b/images/runtime/node/20/bullseye.Dockerfile index 6176d3fcb8..1dd91e2bda 100644 --- a/images/runtime/node/20/bullseye.Dockerfile +++ b/images/runtime/node/20/bullseye.Dockerfile @@ -1,4 +1,109 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bullseye +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base +ARG IMAGES_DIR=/tmp/oryx/images + +RUN apt-get update \ + && apt-get install -y \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +# NOTE: This is a list of keys for ALL Node versions and also Yarn package installs. +# Receiving them once speeds up building of individual node versions as they all derive +# from this image. + +# Gpg keys listed at https://github.com/nodejs/node + +RUN ${IMAGES_DIR}/receiveGpgKeys.sh \ + 6A010C5166006599AA17F08146C2130DFD2497F5 + +ARG YARN_VERSION +ENV YARN_VERSION ${YARN_VERSION} + +COPY images/yarn-v${YARN_VERSION}.tar.gz . + +RUN mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -15,7 +120,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh node /opt/startupcmdgen/startupcmdgen # Download Node.js directly from official source -FROM ${BASE_IMAGE} AS nodeDownloader +FROM oryx_runtime_base AS nodeDownloader ARG NODE20_VERSION WORKDIR /tmp/node-download RUN apt-get update \ @@ -31,8 +136,7 @@ RUN apt-get update \ && tar -xJf "node-v${NODE20_VERSION}-linux-x64.tar.xz" -C /opt/nodejs --strip-components=1 \ && rm -rf /tmp/node-download -#FROM oryxdevmcr.azurecr.io/private/oryx/oryx-node-run-base-bullseye:${BUILD_NUMBER} -FROM ${BASE_IMAGE} +FROM oryx_runtime_base RUN groupadd --gid 1000 node \ && useradd --uid 1000 --gid node --shell /bin/bash --create-home node diff --git a/images/runtime/node/22/bookworm.Dockerfile b/images/runtime/node/22/bookworm.Dockerfile index 477e79fc5a..53db7ab7cf 100644 --- a/images/runtime/node/22/bookworm.Dockerfile +++ b/images/runtime/node/22/bookworm.Dockerfile @@ -1,4 +1,109 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bookworm +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base +ARG IMAGES_DIR=/tmp/oryx/images + +RUN apt-get update \ + && apt-get install -y \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +# NOTE: This is a list of keys for ALL Node versions and also Yarn package installs. +# Receiving them once speeds up building of individual node versions as they all derive +# from this image. + +# Gpg keys listed at https://github.com/nodejs/node + +RUN ${IMAGES_DIR}/receiveGpgKeys.sh \ + 6A010C5166006599AA17F08146C2130DFD2497F5 + +ARG YARN_VERSION +ENV YARN_VERSION ${YARN_VERSION} + +COPY images/yarn-v${YARN_VERSION}.tar.gz . + +RUN mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -15,7 +120,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh node /opt/startupcmdgen/startupcmdgen # Download Node.js directly from official source -FROM ${BASE_IMAGE} AS nodeDownloader +FROM oryx_runtime_base AS nodeDownloader ARG NODE22_VERSION WORKDIR /tmp/node-download RUN apt-get update \ @@ -31,8 +136,7 @@ RUN apt-get update \ && tar -xJf "node-v${NODE22_VERSION}-linux-x64.tar.xz" -C /opt/nodejs --strip-components=1 \ && rm -rf /tmp/node-download -#FROM oryxdevmcr.azurecr.io/private/oryx/oryx-node-run-base-bookworm:${BUILD_NUMBER} -FROM ${BASE_IMAGE} +FROM oryx_runtime_base RUN groupadd --gid 1000 node \ && useradd --uid 1000 --gid node --shell /bin/bash --create-home node diff --git a/images/runtime/node/22/bullseye.Dockerfile b/images/runtime/node/22/bullseye.Dockerfile index 3dea667a57..5dd4dd125e 100644 --- a/images/runtime/node/22/bullseye.Dockerfile +++ b/images/runtime/node/22/bullseye.Dockerfile @@ -1,4 +1,109 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bullseye +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base +ARG IMAGES_DIR=/tmp/oryx/images + +RUN apt-get update \ + && apt-get install -y \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +# NOTE: This is a list of keys for ALL Node versions and also Yarn package installs. +# Receiving them once speeds up building of individual node versions as they all derive +# from this image. + +# Gpg keys listed at https://github.com/nodejs/node + +RUN ${IMAGES_DIR}/receiveGpgKeys.sh \ + 6A010C5166006599AA17F08146C2130DFD2497F5 + +ARG YARN_VERSION +ENV YARN_VERSION ${YARN_VERSION} + +COPY images/yarn-v${YARN_VERSION}.tar.gz . + +RUN mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -15,7 +120,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh node /opt/startupcmdgen/startupcmdgen # Download Node.js directly from official source -FROM ${BASE_IMAGE} AS nodeDownloader +FROM oryx_runtime_base AS nodeDownloader ARG NODE22_VERSION WORKDIR /tmp/node-download RUN apt-get update \ @@ -31,8 +136,7 @@ RUN apt-get update \ && tar -xJf "node-v${NODE22_VERSION}-linux-x64.tar.xz" -C /opt/nodejs --strip-components=1 \ && rm -rf /tmp/node-download -#FROM oryxdevmcr.azurecr.io/private/oryx/oryx-node-run-base-bullseye:${BUILD_NUMBER} -FROM ${BASE_IMAGE} +FROM oryx_runtime_base RUN groupadd --gid 1000 node \ && useradd --uid 1000 --gid node --shell /bin/bash --create-home node diff --git a/images/runtime/node/24/noble.Dockerfile b/images/runtime/node/24/noble.Dockerfile index 39f849bcad..55714c2e1e 100644 --- a/images/runtime/node/24/noble.Dockerfile +++ b/images/runtime/node/24/noble.Dockerfile @@ -1,6 +1,111 @@ -ARG BASE_IMAGE +ARG OS_TYPE=ubuntu +ARG OS_FLAVOR=noble +ARG INCLUDE_AZURELINUX_CERTS=true ARG FEED_ACCESSTOKEN +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base +ARG IMAGES_DIR=/tmp/oryx/images + +RUN apt-get update \ + && apt-get install -y \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +# NOTE: This is a list of keys for ALL Node versions and also Yarn package installs. +# Receiving them once speeds up building of individual node versions as they all derive +# from this image. + +# Gpg keys listed at https://github.com/nodejs/node + +RUN ${IMAGES_DIR}/receiveGpgKeys.sh \ + 6A010C5166006599AA17F08146C2130DFD2497F5 + +ARG YARN_VERSION +ENV YARN_VERSION ${YARN_VERSION} + +COPY images/yarn-v${YARN_VERSION}.tar.gz . + +RUN mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz + # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -16,7 +121,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh node /opt/startupcmdgen/startupcmdgen # Download Node.js directly from official source -FROM ${BASE_IMAGE} AS nodeDownloader +FROM oryx_runtime_base AS nodeDownloader ARG NODE24_VERSION WORKDIR /tmp/node-download RUN apt-get update \ @@ -32,8 +137,7 @@ RUN apt-get update \ && tar -xJf "node-v${NODE24_VERSION}-linux-x64.tar.xz" -C /opt/nodejs --strip-components=1 \ && rm -rf /tmp/node-download -#FROM oryxdevmcr.azurecr.io/private/oryx/oryx-node-run-base-bullseye:${BUILD_NUMBER} -FROM ${BASE_IMAGE} +FROM oryx_runtime_base RUN groupadd --gid 1001 node \ && useradd --uid 1001 --gid node --shell /bin/bash --create-home node diff --git a/images/runtime/node/26/resolute.Dockerfile b/images/runtime/node/26/resolute.Dockerfile index a3c372144c..3030622a34 100644 --- a/images/runtime/node/26/resolute.Dockerfile +++ b/images/runtime/node/26/resolute.Dockerfile @@ -1,4 +1,56 @@ -ARG BASE_IMAGE +ARG OS_TYPE=ubuntu +ARG OS_FLAVOR=resolute +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base +ARG INCLUDE_AZURELINUX_CERTS + +RUN apt-get update \ + && apt-get upgrade -y \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget \ + unzip \ + zstd \ + # Not shipped in Resolute, but will be required by Node runtime. It is tiny, would save from unexpected runtime failures in other frameworks too + libatomic1 \ + tzdata \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; # build the Oryx startup-script generator (the `oryx` CLI). FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -15,7 +67,7 @@ RUN chmod +x build.sh && ./build.sh node /opt/startupcmdgen/startupcmdgen # Download Node.js directly from official source and verify SHA256 -FROM ${BASE_IMAGE} AS nodeDownloader +FROM oryx_runtime_base AS nodeDownloader ARG NODE_FULL_VERSION WORKDIR /tmp/node-download RUN curl -fsSLO "https://nodejs.org/dist/v${NODE_FULL_VERSION}/node-v${NODE_FULL_VERSION}-linux-x64.tar.xz" \ @@ -30,7 +82,7 @@ RUN curl -fsSLO "https://nodejs.org/dist/v${NODE_FULL_VERSION}/node-v${NODE_FULL && rm -rf /tmp/node-download -FROM ${BASE_IMAGE} +FROM oryx_runtime_base RUN groupadd --gid 1001 node \ && useradd --uid 1001 --gid node --shell /bin/bash --create-home node diff --git a/images/runtime/node/README.md b/images/runtime/node/README.md index ee1e9c77a6..3d60011841 100644 --- a/images/runtime/node/README.md +++ b/images/runtime/node/README.md @@ -1,24 +1,21 @@ -# Node images +# Node runtime images -The Dockerfiles for our Node images are either produced by a template, which derives from the official image, or -created manually from the `buildpack-deps` base. +The active runtime Dockerfiles are checked in under each major version and OS: +20 and 22 use Bullseye/Bookworm, 24 uses Noble, and 26 uses Resolute. +Their common base and Node-specific base are stages in the same Dockerfile. +No separate base build, external `BASE_IMAGE`, or Dockerfile generator is required. -# Images derived from `buildpack-deps` +Build using the repository root as the Docker context. Supply exact Node and +tooling versions from `images/constants.yml`, and provide the configured package +feed credential using the `npmrc` BuildKit secret. -The reason we do rebuild some old images instead of relying on the official ones is security: since -the official images for older versions were made using the version of `buildpack-deps` available at the time, which -contained vulnerabilities, we rebuild them using the current version of that base image. The portion of our -Dockerfiles that install Node (which we always have in its own stage called `node-original-image`) are identical to the -ones used in the official Node image for each particular version. +The runtime retains signed Node download verification and the Go startup +generator. The Resolute profile has its own dependencies and Yarn installation; +it does not inherit the classic Node base. -# Generate images from template +## Adding a major version -Since our node images are identical except for the base image, which determines the node version, -our final node images are generated from a template file, `./template.Dockerfile`, which contains the placeholder -for the base image name. - -To generate the dockerfiles for all the images, run `./generateDockerfiles.sh`. - -## Adding new versions of Node - -To add a new Node version, add a new directory with the version name, and a base Dockerfile named `./base.Dockerfile`, that should contain the node binaries. The script `./generateDockerfiles.sh` will then produce the Dockerfile for the final image using the `./base.Dockerfile` image as its base. \ No newline at end of file +Declare its exact version and supported OS list in `images/constants.yml`, add +the corresponding runtime Dockerfile, and select it in the runtime pipeline. +Reuse the matching multi-stage profile where behavior is unchanged; preserve +intentional OS, startup-tooling, and user-ID differences. \ No newline at end of file diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 2e2871aeb5..764acdef05 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -1,4 +1,155 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bullseye +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -15,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # do NOT merge this content with above line because the diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 9f15c5bfc1..1d40c4f1c6 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -1,4 +1,155 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bookworm +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -15,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # do NOT merge this content with above line because the diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 5cbadd61b9..92c5c7b15e 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -1,4 +1,155 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bullseye +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -15,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index f4ba4b2da7..4fa0e17966 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -1,4 +1,156 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bookworm +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* + # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -14,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # Install the Microsoft SQL Server PDO driver on supported versions only. diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index a2d6d3614c..1f366d3199 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -1,4 +1,155 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bullseye +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -15,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # do NOT merge this content with above line because the diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 16c4118114..2d8257ed72 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -1,4 +1,156 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bookworm +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* + # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -14,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # Install the Microsoft SQL Server PDO driver on supported versions only. diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index cc93201cdd..b33f6bf458 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -1,4 +1,155 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bullseye +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -15,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # do NOT merge this content with above line because the diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index b5d28541c4..5052345d25 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -1,4 +1,156 @@ -ARG BASE_IMAGE +ARG OS_TYPE=ubuntu +ARG OS_FLAVOR=noble +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu +ARG OS_TYPE +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + $([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \ + $([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* + # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -14,7 +166,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # Install the Microsoft SQL Server PDO driver on supported versions only. diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index a2ef643179..1987fa05b6 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -1,4 +1,152 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bullseye +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +RUN set -eux; \ + apt-get update; \ + apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -15,7 +163,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # Install the Microsoft SQL Server PDO driver on supported versions only. diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 6174ff0995..958418f396 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -1,4 +1,152 @@ -ARG BASE_IMAGE +ARG OS_TYPE=debian +ARG OS_FLAVOR=bookworm +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +FROM oryx_run_base AS oryx_runtime_base + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +RUN set -eux; \ + apt-get update; \ + apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + libzip-dev \ + libpng-dev \ + libjpeg-dev \ + libpq-dev \ + libldap2-dev \ + libldb-dev \ + libicu-dev \ + libgmp-dev \ + libmagickwand-dev \ + libc-client-dev \ + libtidy-dev \ + libkrb5-dev \ + libxslt-dev \ + openssh-server \ + vim \ + wget \ + tcptraceroute \ + mariadb-client \ + openssl \ + libedit-dev \ + libsodium-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libonig-dev \ + libcurl4-openssl-dev \ + libldap2-dev \ + zlib1g-dev \ + apache2-dev \ + libsqlite3-dev \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && ACCEPT_EULA=Y \ + DEBIAN_FRONTEND=noninteractive \ + apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -15,7 +163,7 @@ ENV BUILD_NUMBER=${BUILD_NUMBER} RUN chmod +x build.sh && ./build.sh php /opt/startupcmdgen/startupcmdgen # From https://github.com/docker-library/php.git -FROM ${BASE_IMAGE} +FROM oryx_runtime_base ARG IMAGES_DIR=/tmp/oryx/images # Install the Microsoft SQL Server PDO driver on supported versions only. diff --git a/images/runtime/python/noble.Dockerfile b/images/runtime/python/noble.Dockerfile index 0a0f585f08..8765dada6e 100644 --- a/images/runtime/python/noble.Dockerfile +++ b/images/runtime/python/noble.Dockerfile @@ -1,5 +1,81 @@ +ARG OS_TYPE=ubuntu +ARG OS_FLAVOR=noble +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS ARG OS_FLAVOR -ARG BASE_IMAGE + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -18,7 +94,7 @@ ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" RUN chmod +x build.sh && ./build.sh python /opt/startupcmdgen/startupcmdgen # Build Python SDK from source in a disposable stage -FROM ${BASE_IMAGE} AS pythonSdkBuilder +FROM oryx_runtime_base AS pythonSdkBuilder ARG OS_FLAVOR ARG PYTHON_FULL_VERSION ARG PYTHON_VERSION @@ -35,7 +111,7 @@ RUN set -e \ && export OS_FLAVOR=${OS_FLAVOR} \ && /tmp/build.sh -FROM ${BASE_IMAGE} as main +FROM oryx_runtime_base AS main ARG IMAGES_DIR=/tmp/oryx/images diff --git a/images/runtime/python/resolute-based/resolute.Dockerfile b/images/runtime/python/resolute-based/resolute.Dockerfile index 3d3e4ef737..0c33b05136 100644 --- a/images/runtime/python/resolute-based/resolute.Dockerfile +++ b/images/runtime/python/resolute-based/resolute.Dockerfile @@ -1,5 +1,56 @@ -ARG OS_FLAVOR -ARG BASE_IMAGE +ARG OS_TYPE=ubuntu +ARG OS_FLAVOR=resolute +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base +ARG INCLUDE_AZURELINUX_CERTS + +RUN apt-get update \ + && apt-get upgrade -y \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget \ + unzip \ + zstd \ + # Not shipped in Resolute, but will be required by Node runtime. It is tiny, would save from unexpected runtime failures in other frameworks too + libatomic1 \ + tzdata \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; # ----------------------------------------------------------------------------- # Stage 1: build the Oryx startup-script generator (the `oryx` CLI) @@ -24,7 +75,7 @@ RUN chmod +x build.sh && ./build.sh python /opt/startupcmdgen/startupcmdgen # build.sh now parses versionsToBuild.txt itself (gpg key + sha256). # Inputs are passed as ENV (ARGs are not visible to scripts). # ----------------------------------------------------------------------------- -FROM ${BASE_IMAGE} AS pythonRuntimeBinariesBuilder +FROM oryx_runtime_base AS pythonRuntimeBinariesBuilder ARG OS_FLAVOR ARG PYTHON_FULL_VERSION ENV OS_FLAVOR=${OS_FLAVOR} @@ -53,7 +104,7 @@ RUN chmod +x /tmp/build.sh /tmp/receiveGpgKeys.sh \ # 5. COPY oryx CLI (per-build, tiny -> last) # ----------------------------------------------------------------------------- -FROM ${BASE_IMAGE} as main +FROM oryx_runtime_base AS main ARG OS_FLAVOR ENV OS_FLAVOR=${OS_FLAVOR} diff --git a/images/runtime/python/template.Dockerfile b/images/runtime/python/template.Dockerfile index 21e4d91e83..419a4a1eee 100644 --- a/images/runtime/python/template.Dockerfile +++ b/images/runtime/python/template.Dockerfile @@ -1,5 +1,82 @@ -ARG DEBIAN_FLAVOR -ARG BASE_IMAGE +ARG DEBIAN_FLAVOR=bullseye +ARG OS_TYPE=debian +ARG OS_FLAVOR=${DEBIAN_FLAVOR} +ARG INCLUDE_AZURELINUX_CERTS=true + +# Stage: (optional) pull Azure Linux CA certificates so we can merge them into BaseOS trust store +# Debian images (especially slim variants) can lag in ca-certificates updates; we optionally add Azure Linux certs. +FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core +ARG INCLUDE_AZURELINUX_CERTS +COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + set -eux; \ + tdnf makecache; \ + tdnf install -y ca-certificates; \ + update-ca-trust extract; \ + tdnf clean all; \ + fi + +FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ARG INCLUDE_AZURELINUX_CERTS +ARG OS_FLAVOR + +COPY images/runtime/scripts/configure-debian-bullseye-snapshot.sh /usr/local/bin/ +# TODO: Remove this once Debian Bullseye and Bookworm provide tzdata 2026e-1 or newer. +COPY images/runtime/scripts/install-debian-tzdata-2026e.sh /usr/local/bin/ +RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ + chmod +x /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ + fi + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + ca-certificates \ + curl \ + gnupg \ + netbase \ + wget + +RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ + /usr/local/bin/install-debian-tzdata-2026e.sh; \ + elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ + fi + +RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ + apt-get update && apt-get install -y --no-install-recommends sq ; \ + fi + +RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ + && rm -rf /var/lib/apt/lists/* + +# Copy Azure linux certs to a temporary location +RUN mkdir -p /tmp/azurelinux-ca-certs && \ + chmod 755 /tmp/azurelinux-ca-certs; +COPY --from=azurelinux-core /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /tmp/azurelinux-ca-certs/tls-ca-bundle.pem + +COPY images/runtime/scripts/install-azurelinux-certs.sh /usr/local/bin/install-azurelinux-certs.sh + +# Add Azure Linux certs to Debian's CA store if the flag is set to true +RUN set -e; \ + if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ + chmod +x /usr/local/bin/install-azurelinux-certs.sh; \ + /usr/local/bin/install-azurelinux-certs.sh /tmp/azurelinux-ca-certs /tmp/azurelinux-ca-certs/tls-ca-bundle.pem; \ + fi; + +# Cleanup script and temporary files +RUN rm -f /usr/local/bin/install-azurelinux-certs.sh; \ + rm -rf /tmp/azurelinux-ca-certs; + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-${DEBIAN_FLAVOR} as startupCmdGen @@ -17,7 +94,7 @@ ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" RUN chmod +x build.sh && ./build.sh python /opt/startupcmdgen/startupcmdgen # Build Python SDK from source in a disposable stage -FROM ${BASE_IMAGE} AS pythonSdkBuilder +FROM oryx_runtime_base AS pythonSdkBuilder ARG DEBIAN_FLAVOR ARG PYTHON_FULL_VERSION ARG PYTHON_VERSION @@ -34,7 +111,7 @@ RUN set -e \ && export OS_FLAVOR=${DEBIAN_FLAVOR} \ && /tmp/build.sh -FROM ${BASE_IMAGE} as main +FROM oryx_runtime_base AS main ARG IMAGES_DIR=/tmp/oryx/images ARG SDK_STORAGE_BASE_URL_VALUE From 20d44ce5a5d7600fc80ed93068d75d723fdc5bed Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 00:13:16 +0530 Subject: [PATCH 02/21] Use signed Debian archive for .NET 8 Bullseye packages Retain APT signature, checksum and metadata expiry verification. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 4 ++++ images/runtime/dotnetcore/8.0/bullseye.Dockerfile | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8395255909..8ff6dfbc5f 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,10 @@ Dockerfiles were already self-contained. Python's shared Debian recipe still selects its OS using `DEBIAN_FLAVOR`, and disposable compiler stages remain part of the runtime build. +The .NET 8 Bullseye runtime uses the official Debian archive because Bullseye +packages have moved off the live mirrors. APT signature, checksum, and metadata +expiry verification remain enabled. + # Testing Locally ## startup script generator `build/testStartupScriptGenerators.sh` will perform tests on all startup script generators written in go. diff --git a/images/runtime/dotnetcore/8.0/bullseye.Dockerfile b/images/runtime/dotnetcore/8.0/bullseye.Dockerfile index 8dec4d7ad1..502da1c9b8 100644 --- a/images/runtime/dotnetcore/8.0/bullseye.Dockerfile +++ b/images/runtime/dotnetcore/8.0/bullseye.Dockerfile @@ -55,7 +55,9 @@ ARG BUILD_DIR=/tmp/oryx/build ARG INCLUDE_AZURELINUX_CERTS ADD build ${BUILD_DIR} -RUN apt-get update \ +# Bullseye packages have moved from the live mirrors to the signed Debian archive. +RUN sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list \ + && apt-get update \ && apt-get install -y --no-install-recommends \ # .NET Core dependencies libc6 \ From 762d56fbadaf0ffbc5b6608a92dc2ac145fb9ddc Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 00:21:47 +0530 Subject: [PATCH 03/21] Avoid serial PHP extension builds and unused Python runtime archives Compile bundled PHP extensions using the same available CPU count as PHP core. Keep Python SDK compression in the SDK driver so runtime builds retain PGO/LTO without packaging an unused SDK archive. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 4 ++++ images/runtime/php-fpm/8.1/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.2/bookworm.Dockerfile | 4 ++-- images/runtime/php-fpm/8.2/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.3/bookworm.Dockerfile | 4 ++-- images/runtime/php-fpm/8.3/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.4/bookworm.Dockerfile | 4 ++-- images/runtime/php-fpm/8.4/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.5/noble.Dockerfile | 4 ++-- images/runtime/php/8.2/bullseye.Dockerfile | 4 ++-- images/runtime/php/8.3/bookworm.Dockerfile | 4 ++-- platforms/python/buildPython.sh | 1 + platforms/python/prereqs/build.sh | 7 ------- 13 files changed, 25 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 8ff6dfbc5f..20a1c58c64 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,10 @@ The .NET 8 Bullseye runtime uses the official Debian archive because Bullseye packages have moved off the live mirrors. APT signature, checksum, and metadata expiry verification remain enabled. +PHP runtime builds use the available CPUs when compiling bundled extensions. +Python keeps PGO/LTO enabled, but only the SDK build driver compresses an SDK +archive; runtime builds copy the installed interpreter directly. + # Testing Locally ## startup script generator `build/testStartupScriptGenerators.sh` will perform tests on all startup script generators written in go. diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 764acdef05..11263c5de9 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -498,7 +498,7 @@ RUN set -eux; \ fi RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -585,7 +585,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 1d40c4f1c6..8d23261cc5 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -502,7 +502,7 @@ RUN set -eux; \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -589,7 +589,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 92c5c7b15e..092e2799a4 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -508,7 +508,7 @@ RUN set -eux; \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -595,7 +595,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 4fa0e17966..41d38eeb58 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -498,7 +498,7 @@ RUN set -eux; \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -585,7 +585,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index 1f366d3199..4109a8af8a 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -502,7 +502,7 @@ RUN set -eux; \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -599,7 +599,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 2d8257ed72..818f164ee9 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -502,7 +502,7 @@ RUN set -eux; \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -574,7 +574,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index b33f6bf458..87ee8a0c3f 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -504,7 +504,7 @@ RUN set -eux; \ && pecl install imap RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -576,7 +576,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 5052345d25..3b9040726b 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -503,7 +503,7 @@ RUN set -eux; \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ pdo \ pdo_mysql \ @@ -572,7 +572,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index 1987fa05b6..2690c47936 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -486,7 +486,7 @@ RUN set -eux; \ fi RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -588,7 +588,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* RUN rm -rf /tmp/oryx diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 958418f396..9d2f90869b 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -487,7 +487,7 @@ RUN set -eux; \ fi RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install gd \ + && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ pdo \ @@ -589,7 +589,7 @@ RUN set -x \ && sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ - && docker-php-ext-install odbc \ + && docker-php-ext-install -j "$(nproc)" odbc \ && rm -rf /var/lib/apt/lists/* RUN rm -rf /tmp/oryx diff --git a/platforms/python/buildPython.sh b/platforms/python/buildPython.sh index c5a8554c8b..90b955f63d 100755 --- a/platforms/python/buildPython.sh +++ b/platforms/python/buildPython.sh @@ -35,6 +35,7 @@ buildPython() { mkdir /usr/src/python cd /usr/src/python OS_FLAVOR=$osFlavor PYTHON_VERSION=$version GPG_KEY=$gpgKey PIP_VERSION=$PIP_VERSION PYTHON_SHA256=$python_sha INSTALL_UV=true /tmp/build.sh + tar -zcf "$targetDir/$pythonSdkFileName" -C "/opt/python/$version" . cd $REPO_DIR rm -r /opt/python/* diff --git a/platforms/python/prereqs/build.sh b/platforms/python/prereqs/build.sh index 04f3616159..e8abc1115e 100755 --- a/platforms/python/prereqs/build.sh +++ b/platforms/python/prereqs/build.sh @@ -7,7 +7,6 @@ set -ex pythonVersion=$PYTHON_VERSION -osFlavor=$OS_FLAVOR python_sha=$PYTHON_SHA256 gpgKey=$GPG_KEY @@ -57,7 +56,6 @@ fi PYTHON_GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py" PIP_VERSION="21.2.4" -pythonSdkFileName=python-$osFlavor-$PYTHON_VERSION.tar.gz tar -xJf /python.tar.xz --strip-components=1 -C . @@ -180,8 +178,3 @@ pipReqSetPath=`find $INSTALLATION_PREFIX/lib -path "*site-packages/pip/_internal if [ -n "$pipReqSetPath" ]; then sed -i 's|logger\.debug('\''Cleaning up\.\.\.'\'')|logger\.info('\''Cleaning up\.\.\.'\'')|' "$pipReqSetPath" fi - -compressedSdkDir="/tmp/compressedSdk/python" -mkdir -p $compressedSdkDir -cd "$INSTALLATION_PREFIX" -tar -zcf $compressedSdkDir/$pythonSdkFileName . From 79af2fb7fa94b2cd8c074bf977a9efd112db0a8e Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 11:15:46 +0530 Subject: [PATCH 04/21] Parallelize PECL builds in runtime images Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 4 +++- images/runtime/php-fpm/8.1/bullseye.Dockerfile | 10 +++++----- images/runtime/php-fpm/8.2/bookworm.Dockerfile | 10 +++++----- images/runtime/php-fpm/8.2/bullseye.Dockerfile | 10 +++++----- images/runtime/php-fpm/8.3/bookworm.Dockerfile | 10 +++++----- images/runtime/php-fpm/8.3/bullseye.Dockerfile | 12 ++++++------ images/runtime/php-fpm/8.4/bookworm.Dockerfile | 8 ++++---- images/runtime/php-fpm/8.4/bullseye.Dockerfile | 8 ++++---- images/runtime/php-fpm/8.5/noble.Dockerfile | 8 ++++---- images/runtime/php/8.2/bullseye.Dockerfile | 12 ++++++------ images/runtime/php/8.3/bookworm.Dockerfile | 12 ++++++------ 11 files changed, 53 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 20a1c58c64..ebd9e79ceb 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,9 @@ The .NET 8 Bullseye runtime uses the official Debian archive because Bullseye packages have moved off the live mirrors. APT signature, checksum, and metadata expiry verification remain enabled. -PHP runtime builds use the available CPUs when compiling bundled extensions. +PHP runtime builds use the available CPUs when compiling bundled and PECL +extensions. PECL receives command-scoped `MAKEFLAGS`, leaving the running +image's environment and extension selection unchanged. Python keeps PGO/LTO enabled, but only the SDK build driver compresses an SDK archive; runtime builds copy the installed interpreter directly. diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 11263c5de9..76c6fed43b 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -527,26 +527,26 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -555,7 +555,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # For php|8.1, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.12.0 RUN set -eux; \ - pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 8d23261cc5..7a0dcf3dec 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -531,26 +531,26 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -559,7 +559,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # For php|8.2, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.12.0 RUN set -eux; \ - pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 092e2799a4..6a50a63e54 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -537,26 +537,26 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -565,7 +565,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # For php|8.2, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.12.0 RUN set -eux; \ - pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 41d38eeb58..6b1e28a7a8 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -527,26 +527,26 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -555,7 +555,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index 4109a8af8a..ccacbaf2a2 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -531,26 +531,26 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -560,7 +560,7 @@ RUN set -eux; \ # For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 RUN set -eux; \ if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ fi @@ -568,7 +568,7 @@ RUN set -eux; \ # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) RUN set -eux; \ if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ fi diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 818f164ee9..396949be2c 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -497,7 +497,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && pecl install imap + && MAKEFLAGS="-j$(nproc)" pecl install imap #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip @@ -530,7 +530,7 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files @@ -540,11 +540,11 @@ RUN pecl install redis && docker-php-ext-enable redis # deprecated from 5.*, so should be avoided RUN set -eux; \ - pecl install mongodb && docker-php-ext-enable mongodb + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index 87ee8a0c3f..a3b0d1b9e9 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -501,7 +501,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && pecl install imap + && MAKEFLAGS="-j$(nproc)" pecl install imap RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ @@ -532,7 +532,7 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files @@ -542,11 +542,11 @@ RUN pecl install redis && docker-php-ext-enable redis # deprecated from 5.*, so should be avoided RUN set -eux; \ - pecl install mongodb && docker-php-ext-enable mongodb + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 3b9040726b..ccbc9fca37 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -498,7 +498,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && pecl install imap + && MAKEFLAGS="-j$(nproc)" pecl install imap #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip @@ -529,7 +529,7 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl -RUN pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files @@ -539,11 +539,11 @@ RUN pecl install redis && docker-php-ext-enable redis # deprecated from 5.*, so should be avoided RUN set -eux; \ - pecl install mongodb && docker-php-ext-enable mongodb + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||" -e "s/\"//g")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||" -e "s/\"//g")/20-sqlsrv.ini diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index 2690c47936..94a0bda926 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -519,28 +519,28 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ RUN set -eux; \ if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ + MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis; \ fi # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -550,7 +550,7 @@ RUN set -eux; \ # For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 RUN set -eux; \ if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ fi @@ -558,7 +558,7 @@ RUN set -eux; \ # PHP 8.2 requires SQL Server drivers 5.12.0; newer drivers require PHP 8.3. RUN set -eux; \ if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ fi diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 9d2f90869b..bbdbe09163 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -520,28 +520,28 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ RUN set -eux; \ if [[ $PHP_VERSION != 5.* ]]; then \ - pecl install redis && docker-php-ext-enable redis; \ + MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis; \ fi # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -551,7 +551,7 @@ RUN set -eux; \ # For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 RUN set -eux; \ if [[ $PHP_VERSION == 8.0.* ]]; then \ - pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ fi @@ -559,7 +559,7 @@ RUN set -eux; \ # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) RUN set -eux; \ if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ fi From 0a200bb721a61385a12c6dad35419d520f027ead Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 15:46:11 +0530 Subject: [PATCH 05/21] Parallelize Python LTO links and clean PHP sources within build layers Preserve PGO/LTO, extension inputs and runtime tools while avoiding serial link code generation and retained extracted PHP source layers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 8 ++++++-- images/runtime/php-fpm/8.1/bullseye.Dockerfile | 10 ++++++---- images/runtime/php-fpm/8.2/bookworm.Dockerfile | 10 ++++++---- images/runtime/php-fpm/8.2/bullseye.Dockerfile | 10 ++++++---- images/runtime/php-fpm/8.3/bookworm.Dockerfile | 10 ++++++---- images/runtime/php-fpm/8.3/bullseye.Dockerfile | 10 ++++++---- images/runtime/php-fpm/8.4/bookworm.Dockerfile | 9 ++++++--- images/runtime/php-fpm/8.4/bullseye.Dockerfile | 9 ++++++--- images/runtime/php-fpm/8.5/noble.Dockerfile | 9 ++++++--- images/runtime/php/8.2/bullseye.Dockerfile | 10 ++++++---- images/runtime/php/8.3/bookworm.Dockerfile | 10 ++++++---- platforms/python/prereqs/build.sh | 3 ++- 12 files changed, 68 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index ebd9e79ceb..2f9ce9dd93 100644 --- a/README.md +++ b/README.md @@ -163,8 +163,12 @@ expiry verification remain enabled. PHP runtime builds use the available CPUs when compiling bundled and PECL extensions. PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. -Python keeps PGO/LTO enabled, but only the SDK build driver compresses an SDK -archive; runtime builds copy the installed interpreter directly. +Extension configuration, compilation, and source cleanup share a layer so +extracted PHP build sources are not retained in the runtime image. The original +source archive remains available to `docker-php-source extract`. +Python keeps PGO/LTO enabled and parallelizes GCC's LTO links. Only the SDK build +driver compresses an SDK archive; runtime builds copy the installed interpreter +directly. # Testing Locally ## startup script generator diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 76c6fed43b..58997989d3 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -495,9 +495,8 @@ RUN set -eux; \ else \ docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + fi \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -526,7 +525,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -586,6 +586,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 7a0dcf3dec..3a1f463924 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -499,9 +499,8 @@ RUN set -eux; \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends apache2-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -530,7 +529,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -590,6 +590,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 6a50a63e54..29113ae759 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -505,9 +505,8 @@ RUN set -eux; \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends apache2-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -536,7 +535,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -596,6 +596,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 6b1e28a7a8..d143c995df 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -495,9 +495,8 @@ RUN set -eux; \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends apache2-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -526,7 +525,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -586,6 +586,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index ccacbaf2a2..dd998fae0a 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -499,9 +499,8 @@ RUN set -eux; \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends apache2-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -530,7 +529,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -600,6 +600,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 396949be2c..4e2d4b633d 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -497,11 +497,11 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" pecl install imap + && MAKEFLAGS="-j$(nproc)" pecl install imap \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -529,7 +529,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -575,6 +576,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index a3b0d1b9e9..781d04c1d4 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -501,9 +501,9 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" pecl install imap + && MAKEFLAGS="-j$(nproc)" pecl install imap \ -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -531,7 +531,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -577,6 +578,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index ccbc9fca37..66a6456cb8 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -498,11 +498,11 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" pecl install imap + && MAKEFLAGS="-j$(nproc)" pecl install imap \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ pdo \ @@ -528,7 +528,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ pdo_odbc \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 @@ -573,6 +574,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* ENV LANG="C.UTF-8" \ diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index 94a0bda926..c4fe81f9b3 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -483,9 +483,8 @@ RUN set -eux; \ else \ docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + fi \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -515,7 +514,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # wddx \ # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN set -eux; \ if [[ $PHP_VERSION != 5.* ]]; then \ @@ -589,6 +589,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* RUN rm -rf /tmp/oryx diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index bbdbe09163..7c88276ba2 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -484,9 +484,8 @@ RUN set -eux; \ else \ docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi - -RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ + fi \ + && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && docker-php-ext-install -j "$(nproc)" gd \ mysqli \ opcache \ @@ -516,7 +515,8 @@ RUN docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ # deprecated from 7.4, so should be avoided in general template for all php versions # wddx \ # xmlrpc \ - xsl + xsl \ + && docker-php-source delete RUN set -eux; \ if [[ $PHP_VERSION != 5.* ]]; then \ @@ -590,6 +590,8 @@ RUN set -x \ && chmod +x ./configure \ && ./configure --with-unixODBC=shared,/usr \ && docker-php-ext-install -j "$(nproc)" odbc \ + && cd / \ + && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* RUN rm -rf /tmp/oryx diff --git a/platforms/python/prereqs/build.sh b/platforms/python/prereqs/build.sh index e8abc1115e..504dfa06b6 100755 --- a/platforms/python/prereqs/build.sh +++ b/platforms/python/prereqs/build.sh @@ -80,7 +80,8 @@ fi --without-ensurepip \ "${configureArgs[@]}" -make -j $(nproc) +# GCC otherwise links LTO partitions serially despite make -j. +make -j "$(nproc)" LDFLAGS_NODIST="-flto=auto" make install From 6f9c0a1d3ceb5d122a65a36552653c23e1467a7c Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 16:34:49 +0530 Subject: [PATCH 06/21] Parallelize older Python LTO partitions and full PGO training Override older CPython nonpartitioning flags with GCC balanced partitions. Run the existing complete PGO suite concurrently while retaining its timeout and all optimization/configuration settings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 9 ++++++--- platforms/python/prereqs/build.sh | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2f9ce9dd93..5898dadcf9 100644 --- a/README.md +++ b/README.md @@ -166,9 +166,12 @@ image's environment and extension selection unchanged. Extension configuration, compilation, and source cleanup share a layer so extracted PHP build sources are not retained in the runtime image. The original source archive remains available to `docker-php-source extract`. -Python keeps PGO/LTO enabled and parallelizes GCC's LTO links. Only the SDK build -driver compresses an SDK archive; runtime builds copy the installed interpreter -directly. +Python keeps PGO/LTO enabled and runs the unchanged default PGO training suite +across the available CPUs. GCC's LTO links use balanced parallel partitions, +including on older CPython versions that otherwise disable partitioning (see +[CPython's upstream change](https://github.com/python/cpython/pull/132258)). +Only the SDK build driver compresses an SDK archive; runtime builds copy the +installed interpreter directly. # Testing Locally ## startup script generator diff --git a/platforms/python/prereqs/build.sh b/platforms/python/prereqs/build.sh index 504dfa06b6..997a953ec6 100755 --- a/platforms/python/prereqs/build.sh +++ b/platforms/python/prereqs/build.sh @@ -80,8 +80,10 @@ fi --without-ensurepip \ "${configureArgs[@]}" -# GCC otherwise links LTO partitions serially despite make -j. -make -j "$(nproc)" LDFLAGS_NODIST="-flto=auto" +# Older CPython disables LTO partitioning; retain the full PGO workload in parallel. +make -j "$(nproc)" \ + LDFLAGS_NODIST="-flto=auto -flto-partition=balanced" \ + PROFILE_TASK="-m test --pgo --timeout=\$(TESTTIMEOUT) -j$(nproc)" make install From 597e74792f12fc81d3898372acd2e5bf3229f019 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 17:21:47 +0530 Subject: [PATCH 07/21] Stop redundant GPG key retries after recovery Reset per-attempt status and report exhausted key retrieval explicitly without changing key servers, fingerprints, or signature verification. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 2 ++ images/receiveGpgKeys.sh | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5898dadcf9..4f6ed0e363 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,8 @@ image's environment and extension selection unchanged. Extension configuration, compilation, and source cleanup share a layer so extracted PHP build sources are not retained in the runtime image. The original source archive remains available to `docker-php-source extract`. +GPG key retrieval stops after the first successful retry and fails explicitly +when all attempts are exhausted. Key fingerprints and signature checks are unchanged. Python keeps PGO/LTO enabled and runs the unchanged default PGO training suite across the available CPUs. GCC's LTO links use balanced parallel partitions, including on older CPython versions that otherwise disable partitioning (see diff --git a/images/receiveGpgKeys.sh b/images/receiveGpgKeys.sh index 0290e98e47..29ab299621 100644 --- a/images/receiveGpgKeys.sh +++ b/images/receiveGpgKeys.sh @@ -16,15 +16,20 @@ fi for keyID in $KEY_IDS; do for i in {1..10}; do echo "Try # $i" + EXIT_CODE=0 gpg --batch --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys "$keyID" || \ gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$keyID" || \ gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$keyID" || \ gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$keyID" || \ EXIT_CODE=$? - if [ "$EXIT_CODE" == '' ] || [ "$EXIT_CODE" == 0 ]; then + if [ "$EXIT_CODE" -eq 0 ]; then echo "Received key successfully." break fi done + if [ "$EXIT_CODE" -ne 0 ]; then + echo "Error: Unable to receive GPG key $keyID after 10 attempts" >&2 + exit 1 + fi done \ No newline at end of file From e4ad8b1d488404378447f20fe296db9e91870983 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 17:46:17 +0530 Subject: [PATCH 08/21] Compile bundled PHP extensions concurrently before installation Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 6 ++++-- images/runtime/php-fpm/8.1/bullseye.Dockerfile | 6 +++++- images/runtime/php-fpm/8.2/bookworm.Dockerfile | 6 +++++- images/runtime/php-fpm/8.2/bullseye.Dockerfile | 6 +++++- images/runtime/php-fpm/8.3/bookworm.Dockerfile | 6 +++++- images/runtime/php-fpm/8.3/bullseye.Dockerfile | 6 +++++- images/runtime/php-fpm/8.4/bookworm.Dockerfile | 6 +++++- images/runtime/php-fpm/8.4/bullseye.Dockerfile | 6 +++++- images/runtime/php-fpm/8.5/noble.Dockerfile | 6 +++++- images/runtime/php/8.2/bullseye.Dockerfile | 6 +++++- images/runtime/php/8.3/bookworm.Dockerfile | 6 +++++- 11 files changed, 54 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4f6ed0e363..ea4ea1623a 100644 --- a/README.md +++ b/README.md @@ -160,8 +160,10 @@ The .NET 8 Bullseye runtime uses the official Debian archive because Bullseye packages have moved off the live mirrors. APT signature, checksum, and metadata expiry verification remain enabled. -PHP runtime builds use the available CPUs when compiling bundled and PECL -extensions. PECL receives command-scoped `MAKEFLAGS`, leaving the running +PHP runtime builds configure and compile two independent bundled extensions +concurrently, splitting make jobs between them. The existing extension installer +then installs and enables the results serially to avoid shared-header races. +PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. Extension configuration, compilation, and source cleanup share a layer so extracted PHP build sources are not retained in the runtime image. The original diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 58997989d3..b06b5f2e3c 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -497,7 +497,7 @@ RUN set -eux; \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ fi \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -526,6 +526,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 3a1f463924..a48d55d1d4 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -501,7 +501,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -530,6 +530,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 29113ae759..e84d5acfa4 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -507,7 +507,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -536,6 +536,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index d143c995df..4c32fe4a6d 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -497,7 +497,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -526,6 +526,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index dd998fae0a..9606c44f76 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -501,7 +501,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -530,6 +530,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 4e2d4b633d..98b1312a2d 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -502,7 +502,7 @@ RUN set -eux; \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -530,6 +530,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index 781d04c1d4..e90bc1a0da 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -504,7 +504,7 @@ RUN set -eux; \ && MAKEFLAGS="-j$(nproc)" pecl install imap \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -532,6 +532,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 66a6456cb8..717a0636c4 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -503,7 +503,7 @@ RUN set -eux; \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ pdo \ pdo_mysql \ @@ -529,6 +529,10 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index c4fe81f9b3..ed43580c1d 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -485,7 +485,7 @@ RUN set -eux; \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ fi \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -515,6 +515,10 @@ RUN set -eux; \ # wddx \ # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN set -eux; \ diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 7c88276ba2..2e5691e6be 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -486,7 +486,7 @@ RUN set -eux; \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ fi \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && docker-php-ext-install -j "$(nproc)" gd \ + && set -- gd \ mysqli \ opcache \ pdo \ @@ -516,6 +516,10 @@ RUN set -eux; \ # wddx \ # xmlrpc \ xsl \ + && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ + -- "$(( ($(nproc) + 1) / 2 ))" \ + && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN set -eux; \ From 7df631051340f93a2346173b4d1ce7c100464ea6 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 18:43:13 +0530 Subject: [PATCH 09/21] Reduce temporary Python training work and overlap runtime dependencies Keep full PGO training and final fat LTO; use native code only for the disposable training interpreter. Prepare OS libraries independently and use four measured PHP configure/compile workers before serial installation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 6 +++++- images/runtime/php-fpm/8.1/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.2/bookworm.Dockerfile | 4 ++-- images/runtime/php-fpm/8.2/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.3/bookworm.Dockerfile | 4 ++-- images/runtime/php-fpm/8.3/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.4/bookworm.Dockerfile | 4 ++-- images/runtime/php-fpm/8.4/bullseye.Dockerfile | 4 ++-- images/runtime/php-fpm/8.5/noble.Dockerfile | 4 ++-- images/runtime/php/8.2/bullseye.Dockerfile | 4 ++-- images/runtime/php/8.3/bookworm.Dockerfile | 4 ++-- images/runtime/python/noble.Dockerfile | 3 ++- images/runtime/python/template.Dockerfile | 3 ++- platforms/python/prereqs/build.sh | 4 +++- 14 files changed, 32 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ea4ea1623a..e3fc282522 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ The .NET 8 Bullseye runtime uses the official Debian archive because Bullseye packages have moved off the live mirrors. APT signature, checksum, and metadata expiry verification remain enabled. -PHP runtime builds configure and compile two independent bundled extensions +PHP runtime builds configure and compile four independent bundled extensions concurrently, splitting make jobs between them. The existing extension installer then installs and enables the results serially to avoid shared-header races. PECL receives command-scoped `MAKEFLAGS`, leaving the running @@ -174,6 +174,10 @@ Python keeps PGO/LTO enabled and runs the unchanged default PGO training suite across the available CPUs. GCC's LTO links use balanced parallel partitions, including on older CPython versions that otherwise disable partitioning (see [CPython's upstream change](https://github.com/python/cpython/pull/132258)). +Only the disposable training interpreter skips LTO; the installed interpreter +keeps full optimization, PGO, and fat LTO objects. Runtime OS dependencies are +installed before copying the compiled interpreter so BuildKit can overlap their +installation with compilation. Only the SDK build driver compresses an SDK archive; runtime builds copy the installed interpreter directly. diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index b06b5f2e3c..8ab5ef973d 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -526,9 +526,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index a48d55d1d4..565f839274 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -530,9 +530,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index e84d5acfa4..5502b847fa 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -536,9 +536,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 4c32fe4a6d..651b554cf0 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -526,9 +526,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index 9606c44f76..dd7bf74beb 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -530,9 +530,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 98b1312a2d..d616145bb3 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -530,9 +530,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index e90bc1a0da..827fbcdd46 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -532,9 +532,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 717a0636c4..63e288feec 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -529,9 +529,9 @@ RUN set -eux; \ # deprecated from 7.4, so should be avoided in general template for all php versions # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index ed43580c1d..d26886f888 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -515,9 +515,9 @@ RUN set -eux; \ # wddx \ # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 2e5691e6be..67d757128d 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -516,9 +516,9 @@ RUN set -eux; \ # wddx \ # xmlrpc \ xsl \ - && printf '%s\n' "$@" | xargs -r -n1 -P2 sh -ec \ + && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ - -- "$(( ($(nproc) + 1) / 2 ))" \ + -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete diff --git a/images/runtime/python/noble.Dockerfile b/images/runtime/python/noble.Dockerfile index 8765dada6e..ed76b2ece3 100644 --- a/images/runtime/python/noble.Dockerfile +++ b/images/runtime/python/noble.Dockerfile @@ -129,6 +129,8 @@ RUN apt-get update \ ADD images ${IMAGES_DIR} RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh + ARG PYTHON_FULL_VERSION ARG PYTHON_VERSION ARG PYTHON_MAJOR_VERSION @@ -161,7 +163,6 @@ ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" ENV CNB_STACK_ID="oryx.stacks.skeleton" LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" -RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh RUN --mount=type=secret,id=pip_index_url,target=/run/secrets/pip_index_url \ pip install --index-url $(cat /run/secrets/pip_index_url) --upgrade pip && \ pip install --index-url $(cat /run/secrets/pip_index_url) gunicorn uvicorn==0.46.0 uvicorn-worker==0.4.0 debugpy viztracer==0.15.6 vizplugins==0.1.3 && \ diff --git a/images/runtime/python/template.Dockerfile b/images/runtime/python/template.Dockerfile index 419a4a1eee..1f0707278e 100644 --- a/images/runtime/python/template.Dockerfile +++ b/images/runtime/python/template.Dockerfile @@ -131,6 +131,8 @@ RUN apt-get update \ ADD images ${IMAGES_DIR} RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh + ARG PYTHON_FULL_VERSION ARG PYTHON_VERSION ARG PYTHON_MAJOR_VERSION @@ -163,7 +165,6 @@ ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" ENV CNB_STACK_ID="oryx.stacks.skeleton" LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" -RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh RUN --mount=type=secret,id=pip_index_url,target=/run/secrets/pip_index_url \ pip install --index-url $(cat /run/secrets/pip_index_url) --upgrade pip && \ pip install --index-url $(cat /run/secrets/pip_index_url) gunicorn debugpy viztracer==0.15.6 vizplugins==0.1.3 && \ diff --git a/platforms/python/prereqs/build.sh b/platforms/python/prereqs/build.sh index 997a953ec6..b36e741786 100755 --- a/platforms/python/prereqs/build.sh +++ b/platforms/python/prereqs/build.sh @@ -80,8 +80,10 @@ fi --without-ensurepip \ "${configureArgs[@]}" -# Older CPython disables LTO partitioning; retain the full PGO workload in parallel. +# Skip LTO only for the disposable training interpreter. +# Older CPython needs explicit balanced partitions for the final LTO links. make -j "$(nproc)" \ + PGO_PROF_GEN_FLAG="-fprofile-generate -fno-lto" \ LDFLAGS_NODIST="-flto=auto -flto-partition=balanced" \ PROFILE_TASK="-m test --pgo --timeout=\$(TESTTIMEOUT) -j$(nproc)" From 90a6da1552ed0171bcf031f587e2372c7365be17 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 19:06:20 +0530 Subject: [PATCH 10/21] Retry transient PECL downloads without retrying native builds Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 3 ++ .../runtime/php-fpm/8.1/bullseye.Dockerfile | 10 ++--- .../runtime/php-fpm/8.2/bookworm.Dockerfile | 10 ++--- .../runtime/php-fpm/8.2/bullseye.Dockerfile | 10 ++--- .../runtime/php-fpm/8.3/bookworm.Dockerfile | 10 ++--- .../runtime/php-fpm/8.3/bullseye.Dockerfile | 12 +++--- .../runtime/php-fpm/8.4/bookworm.Dockerfile | 8 ++-- .../runtime/php-fpm/8.4/bullseye.Dockerfile | 8 ++-- images/runtime/php-fpm/8.5/noble.Dockerfile | 8 ++-- images/runtime/php/8.2/bullseye.Dockerfile | 12 +++--- images/runtime/php/8.3/bookworm.Dockerfile | 12 +++--- images/runtime/php/install-pecl.sh | 43 +++++++++++++++++++ 12 files changed, 96 insertions(+), 50 deletions(-) create mode 100644 images/runtime/php/install-pecl.sh diff --git a/README.md b/README.md index e3fc282522..91697b723c 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,9 @@ concurrently, splitting make jobs between them. The existing extension installer then installs and enables the results serially to avoid shared-header races. PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. +PECL downloads retry up to three times in isolated temporary directories; +compilation and installation failures are not retried. The same package requests, +including pinned SQL Server driver versions, still go through PECL's installer. Extension configuration, compilation, and source cleanup share a layer so extracted PHP build sources are not retained in the runtime image. The original source archive remains available to `docker-php-source extract`. diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 8ab5ef973d..aa9702769e 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -531,26 +531,26 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -559,7 +559,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # For php|8.1, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.12.0 RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 565f839274..2eebdc24a7 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -535,26 +535,26 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -563,7 +563,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # For php|8.2, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.12.0 RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 5502b847fa..e898c3bc25 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -541,26 +541,26 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -569,7 +569,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # For php|8.2, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.12.0 RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 651b554cf0..621c95bd33 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -531,26 +531,26 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -559,7 +559,7 @@ RUN set -eux; \ # - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index dd7bf74beb..f63529b954 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -535,26 +535,26 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -564,7 +564,7 @@ RUN set -eux; \ # For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 RUN set -eux; \ if [[ $PHP_VERSION == 8.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ fi @@ -572,7 +572,7 @@ RUN set -eux; \ # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) RUN set -eux; \ if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ fi diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index d616145bb3..28529e815b 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -497,7 +497,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" pecl install imap \ + && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip @@ -535,7 +535,7 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files @@ -545,11 +545,11 @@ RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # deprecated from 5.*, so should be avoided RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index 827fbcdd46..0832d8d099 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -501,7 +501,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" pecl install imap \ + && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ && set -- gd \ @@ -537,7 +537,7 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files @@ -547,11 +547,11 @@ RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # deprecated from 5.*, so should be avoided RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 63e288feec..14a459689a 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -498,7 +498,7 @@ RUN set -eux; \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" pecl install imap \ + && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ #33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip @@ -534,7 +534,7 @@ RUN set -eux; \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ && docker-php-source delete -RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis +RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files @@ -544,11 +544,11 @@ RUN MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis # deprecated from 5.*, so should be avoided RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.3.0) RUN set -eux; \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||" -e "s/\"//g")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||" -e "s/\"//g")/20-sqlsrv.ini diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index d26886f888..8534aa07ad 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -523,28 +523,28 @@ RUN set -eux; \ RUN set -eux; \ if [[ $PHP_VERSION != 5.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis; \ fi # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -554,7 +554,7 @@ RUN set -eux; \ # For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 RUN set -eux; \ if [[ $PHP_VERSION == 8.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ fi @@ -562,7 +562,7 @@ RUN set -eux; \ # PHP 8.2 requires SQL Server drivers 5.12.0; newer drivers require PHP 8.3. RUN set -eux; \ if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ fi diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 67d757128d..3ebd360e9d 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -524,28 +524,28 @@ RUN set -eux; \ RUN set -eux; \ if [[ $PHP_VERSION != 5.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install redis && docker-php-ext-enable redis; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis; \ fi # https://github.com/Imagick/imagick/issues/331 # https://github.com/ihneo/php/pull/24/files RUN set -eux; \ if [[ $PHP_VERSION != 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install imagick && docker-php-ext-enable imagick; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imagick && docker-php-ext-enable imagick; \ fi # deprecated from 5.*, so should be avoided RUN set -eux; \ if [[ $PHP_VERSION != 5.* && $PHP_VERSION != 7.0.* ]]; then \ echo "pecl/mongodb requires PHP (version >= 7.1.0, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mongodb && docker-php-ext-enable mongodb; \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mongodb && docker-php-ext-enable mongodb; \ fi # https://github.com/microsoft/mysqlnd_azure, Supports 7.2*, 7.3* and 7.4* RUN set -eux; \ if [[ $PHP_VERSION == 7.2.* || $PHP_VERSION == 7.3.* || $PHP_VERSION == 7.4.* ]]; then \ echo "pecl/mysqlnd_azure requires PHP (version >= 7.2.*, version <= 7.99.99)"; \ - MAKEFLAGS="-j$(nproc)" pecl install mysqlnd_azure \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" mysqlnd_azure \ && docker-php-ext-enable mysqlnd_azure; \ fi @@ -555,7 +555,7 @@ RUN set -eux; \ # For php|8.0, latest stable version of pecl/sqlsrv, pecl/pdo_sqlsrv is 5.11.0 RUN set -eux; \ if [[ $PHP_VERSION == 8.0.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv-5.11.0 pdo_sqlsrv-5.11.0 \ && echo extension=pdo_sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> $(php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||")/20-sqlsrv.ini; \ fi @@ -563,7 +563,7 @@ RUN set -eux; \ # Latest pecl/sqlsrv, pecl/pdo_sqlsrv requires PHP (version >= 8.1.0) RUN set -eux; \ if [[ $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - MAKEFLAGS="-j$(nproc)" pecl install sqlsrv pdo_sqlsrv \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" sqlsrv pdo_sqlsrv \ && echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ && echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini; \ fi diff --git a/images/runtime/php/install-pecl.sh b/images/runtime/php/install-pecl.sh new file mode 100644 index 0000000000..672605a858 --- /dev/null +++ b/images/runtime/php/install-pecl.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT license. +# -------------------------------------------------------------------------------------------- + +set -euo pipefail + +if [ "$#" -eq 0 ]; then + echo "Usage: install-pecl.sh package [package ...]" >&2 + exit 2 +fi + +downloadDir=$(mktemp -d) +trap 'rm -rf -- "$downloadDir"' EXIT +archives=() + +for package in "$@"; do + for attempt in 1 2 3; do + mkdir "$downloadDir/${#archives[@]}-$attempt" + cd "$downloadDir/${#archives[@]}-$attempt" + if pecl download "$package"; then + files=("$PWD"/*.tgz) + if [ "${#files[@]}" -ne 1 ] || [ ! -s "${files[0]}" ]; then + echo "PECL download did not produce one archive for $package" >&2 + exit 1 + fi + archives+=("${files[0]}") + break + else + status=$? + fi + if [ "$attempt" -eq 3 ]; then + echo "PECL download failed for $package after $attempt attempts" >&2 + exit "$status" + fi + echo "PECL download failed for $package (attempt $attempt); retrying" >&2 + sleep "$((attempt * 2))" + done +done + +# Retry only network acquisition, never compilation or installation failures. +pecl install "${archives[@]}" From a06ed1bd1a406384f3a8e82030d956e67353701f Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Fri, 13 Nov 2026 19:20:06 +0530 Subject: [PATCH 11/21] Avoid parsing imported CA certificates repeatedly Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 2 ++ .../scripts/install-azurelinux-certs.sh | 20 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 91697b723c..09751b38e5 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,8 @@ installed before copying the compiled interpreter so BuildKit can overlap their installation with compilation. Only the SDK build driver compresses an SDK archive; runtime builds copy the installed interpreter directly. +Azure Linux CA imports read each certificate's subject and SHA256 fingerprint +in one OpenSSL invocation, retaining the existing validation and trust-store deduplication. # Testing Locally ## startup script generator diff --git a/images/runtime/scripts/install-azurelinux-certs.sh b/images/runtime/scripts/install-azurelinux-certs.sh index 7522912064..f923dba1e7 100644 --- a/images/runtime/scripts/install-azurelinux-certs.sh +++ b/images/runtime/scripts/install-azurelinux-certs.sh @@ -62,20 +62,27 @@ sanitize_filename() { } fingerprint_sha256() { - openssl x509 -in "$1" -noout -fingerprint -sha256 | cut -d= -f2 + local fingerprint + fingerprint=$(openssl x509 -in "$1" -noout -fingerprint -sha256) || return 1 + printf '%s\n' "${fingerprint#*=}" } process_certificate() { local azlCert="$1" dest_dir="$2" idx="$3" + local metadata fp="" subject="" line - # Validate the cert - if ! openssl x509 -in "$azlCert" -noout -subject >/dev/null 2>&1; then + # Validate and read both fields in one OpenSSL invocation. + if ! metadata=$(openssl x509 -in "$azlCert" -noout -subject -nameopt RFC2253 -fingerprint -sha256 2>/dev/null); then err "Invalid cert: $azlCert" return 1 fi + while IFS= read -r line; do + case "$line" in + subject=*) subject="$line" ;; + *Fingerprint=*) fp="${line#*=}" ;; + esac + done <<< "$metadata" - local fp - fp=$(fingerprint_sha256 "$azlCert") || true [ -n "$fp" ] || { err "Could not compute fingerprint for $azlCert"; return 1; } # Duplicate in already installed store? @@ -92,8 +99,7 @@ process_certificate() { printf '%s\n' "$fp" >> "$TMP_CERTS_DIR/imported-azl-fingerprints.txt" # Derive name - local subject cn - subject=$(openssl x509 -in "$azlCert" -noout -subject -nameopt RFC2253) + local cn cn=$(printf '%s' "$subject" | sed -n 's/.*CN=\([^,]*\).*/\1/p') # If CN extraction failed, fallback to full subject or fingerprint From 938a7bcbf7c595a3597c771dce4deb4e7e750974 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Sat, 14 Nov 2026 12:50:04 +0530 Subject: [PATCH 12/21] Compile PHP 8.2 FPM shared modules with the interpreter Keep PDO, mbstring, IMAP, PDO_MYSQL and sockets on their original standalone profiles. Strip and enable the other 22 shared modules with the existing helpers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 5 +++ .../runtime/php-fpm/8.2/bookworm.Dockerfile | 45 +++++++------------ .../runtime/php-fpm/8.2/bullseye.Dockerfile | 45 +++++++------------ 3 files changed, 39 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 09751b38e5..76129c2a81 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,11 @@ expiry verification remain enabled. PHP runtime builds configure and compile four independent bundled extensions concurrently, splitting make jobs between them. The existing extension installer then installs and enables the results serially to avoid shared-header races. +PHP 8.2 FPM builds compile 22 bundled shared modules with the interpreter, avoiding +repeated configure work. PDO, mbstring, IMAP, PDO_MYSQL, and sockets retain their +standalone build profiles; merging those profiles can change library detection, +default socket settings, or exposed constants. The jointly built modules are +stripped and enabled with the existing helpers, preserving the module inventory. PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. PECL downloads retry up to three times in isolated temporary directories; diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 2eebdc24a7..ad81759903 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -333,6 +333,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -498,43 +508,22 @@ RUN set -eux; \ apt-get update \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ imap \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ - && docker-php-source delete + && docker-php-source delete \ + && set -- gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip bcmath \ + pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem sysvshm pdo_odbc xsl \ + && extension_dir="$(php-config --extension-dir)" \ + && for extension; do strip --strip-all "$extension_dir/$extension.so"; done \ + && docker-php-ext-enable "$@" RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index e898c3bc25..44cf9f78ca 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -341,6 +341,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -504,43 +514,22 @@ RUN set -eux; \ apt-get update \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ imap \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ - && docker-php-source delete + && docker-php-source delete \ + && set -- gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip bcmath \ + pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem sysvshm pdo_odbc xsl \ + && extension_dir="$(php-config --extension-dir)" \ + && for extension; do strip --strip-all "$extension_dir/$extension.so"; done \ + && docker-php-ext-enable "$@" RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 From 1502dda615dc17aabb3ed38179655a6664f59c95 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Sat, 14 Nov 2026 13:48:57 +0530 Subject: [PATCH 13/21] Compile PHP 8.5 FPM bundled modules with the interpreter Preserve standalone PDO, PDO_MYSQL and sockets profiles, built-in OPcache, external IMAP and the separate ODBC build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 3 ++ images/runtime/php-fpm/8.5/noble.Dockerfile | 48 +++++++-------------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 76129c2a81..f9a4c93890 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,9 @@ repeated configure work. PDO, mbstring, IMAP, PDO_MYSQL, and sockets retain thei standalone build profiles; merging those profiles can change library detection, default socket settings, or exposed constants. The jointly built modules are stripped and enabled with the existing helpers, preserving the module inventory. +PHP 8.5 FPM builds compile 21 bundled shared modules with the interpreter. +PDO, PDO_MYSQL, and sockets retain their standalone profiles; built-in OPcache, +external PECL IMAP, and the separate ODBC build remain unchanged. PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. PECL downloads retry up to three times in isolated temporary directories; diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 14a459689a..a8f534b940 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -334,6 +334,15 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -495,45 +504,20 @@ RUN set -eux; \ apt-get update \ && apt-get upgrade -y \ && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - # From php 8.4 version imap is removed from php core and moved to pecl - # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ + # IMAP is external from PHP 8.4 onward. && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ - -#33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip - - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - pdo \ + && docker-php-source extract \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ - pcntl \ - calendar \ - exif \ - gettext \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ - && docker-php-source delete + && docker-php-source delete \ + && docker-php-ext-enable gd mysqli pdo_pgsql pgsql ldap intl gmp zip \ + bcmath pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem \ + sysvshm pdo_odbc xsl RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 From 214a3cf467175009ce1ca12798fe4d915e3578be Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Sat, 14 Nov 2026 14:48:25 +0530 Subject: [PATCH 14/21] Reduce remaining PHP cold runtime build overhead Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 9 +++ .../runtime/php-fpm/8.2/bookworm.Dockerfile | 27 +++---- .../runtime/php-fpm/8.3/bullseye.Dockerfile | 69 ++++++------------ .../runtime/php-fpm/8.4/bullseye.Dockerfile | 72 +++++++------------ 4 files changed, 65 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index f9a4c93890..d7b2a18ea2 100644 --- a/README.md +++ b/README.md @@ -168,9 +168,18 @@ repeated configure work. PDO, mbstring, IMAP, PDO_MYSQL, and sockets retain thei standalone build profiles; merging those profiles can change library detection, default socket settings, or exposed constants. The jointly built modules are stripped and enabled with the existing helpers, preserving the module inventory. +PHP 8.3 and 8.4 FPM Bullseye builds also compile 22 bundled shared modules with +the interpreter. PDO, PDO_MYSQL, mbstring, and sockets retain their standalone +profiles; PHP 8.3 also builds bundled IMAP separately, while PHP 8.4 retains +external PECL IMAP. Their module enablement and non-stripping behavior remain +unchanged, as does the separate ODBC build. PHP 8.5 FPM builds compile 21 bundled shared modules with the interpreter. PDO, PDO_MYSQL, and sockets retain their standalone profiles; built-in OPcache, external PECL IMAP, and the separate ODBC build remain unchanged. +PHP 8.2 FPM Bookworm and PHP 8.3/8.4 FPM Bullseye reuse fresh APT indexes for the +persistent-dependency upgrade and group Nginx repository setup and package +installation. They avoid the adjacent duplicate extension-phase upgrade; +package upgrades, ODBC holds, and Nginx signing-key verification remain enabled. PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. PECL downloads retry up to three times in isolated temporary directories; diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index ad81759903..9c171665d4 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -143,14 +143,9 @@ RUN set -eux; \ apache2-dev \ libsqlite3-dev \ ; \ + ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && ACCEPT_EULA=Y \ - DEBIAN_FRONTEND=noninteractive \ - apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -448,16 +443,15 @@ ENV NGINX_RUN_USER www-data # Edit the default DocumentRoot setting ENV NGINX_DOCUMENT_ROOT /home/site/wwwroot # Install NGINX version from official nginx.org repository -RUN apt-get update -RUN apt install curl gnupg2 nano -y -RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg \ - && gpg --no-default-keyring \ +RUN set -euxo pipefail; \ + curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg; \ + gpg --no-default-keyring \ --keyring /usr/share/keyrings/nginx-archive-keyring.gpg \ --list-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ - || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; } \ - && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bookworm nginx" > /etc/apt/sources.list.d/nginx.list -RUN apt-get update -RUN yes '' | apt-get install nginx -y + || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; }; \ + echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bookworm nginx" > /etc/apt/sources.list.d/nginx.list; \ + apt-get update; \ + apt-get install -y curl gnupg2 nano nginx RUN rm -f /etc/nginx/conf.d/default.conf \ && mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled COPY images/runtime/php-fpm/nginx_conf/default.conf /etc/nginx/sites-available/default @@ -505,10 +499,7 @@ RUN apt-mark hold msodbcsql17 msodbcsql18 odbcinst1debian2 odbcinst unixodbc uni && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h RUN set -eux; \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ && set -- pdo \ pdo_mysql \ mbstring \ diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index f63529b954..a1cdf11c65 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -143,14 +143,9 @@ RUN set -eux; \ apache2-dev \ libsqlite3-dev \ ; \ + ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && ACCEPT_EULA=Y \ - DEBIAN_FRONTEND=noninteractive \ - apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -336,6 +331,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -438,16 +443,15 @@ ENV NGINX_RUN_USER www-data # Edit the default DocumentRoot setting ENV NGINX_DOCUMENT_ROOT /home/site/wwwroot # Install NGINX version from official nginx.org repository -RUN apt-get update -RUN apt install curl gnupg2 nano -y -RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg \ - && gpg --no-default-keyring \ +RUN set -euxo pipefail; \ + curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg; \ + gpg --no-default-keyring \ --keyring /usr/share/keyrings/nginx-archive-keyring.gpg \ --list-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ - || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; } \ - && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bullseye nginx" > /etc/apt/sources.list.d/nginx.list -RUN apt-get update -RUN yes '' | apt-get install nginx -y + || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; }; \ + echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bullseye nginx" > /etc/apt/sources.list.d/nginx.list; \ + apt-get update; \ + apt-get install -y curl gnupg2 nano nginx RUN rm -f /etc/nginx/conf.d/default.conf \ && mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled COPY images/runtime/php-fpm/nginx_conf/default.conf /etc/nginx/sites-available/default @@ -495,46 +499,19 @@ RUN apt-mark hold msodbcsql17 msodbcsql18 odbcinst1debian2 odbcinst unixodbc uni && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h RUN set -eux; \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ imap \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ - && docker-php-source delete + && docker-php-source delete \ + && docker-php-ext-enable gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip bcmath \ + pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem sysvshm pdo_odbc xsl RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index 0832d8d099..ce3d36f878 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -143,14 +143,9 @@ RUN set -eux; \ apache2-dev \ libsqlite3-dev \ ; \ + ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && ACCEPT_EULA=Y \ - DEBIAN_FRONTEND=noninteractive \ - apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bullseye as startupCmdGen @@ -336,6 +331,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -438,16 +443,15 @@ ENV NGINX_RUN_USER www-data # Edit the default DocumentRoot setting ENV NGINX_DOCUMENT_ROOT /home/site/wwwroot # Install NGINX version from official nginx.org repository -RUN apt-get update -RUN apt install curl gnupg2 nano -y -RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg \ - && gpg --no-default-keyring \ +RUN set -euxo pipefail; \ + curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg; \ + gpg --no-default-keyring \ --keyring /usr/share/keyrings/nginx-archive-keyring.gpg \ --list-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ - || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; } \ - && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bullseye nginx" > /etc/apt/sources.list.d/nginx.list -RUN apt-get update -RUN yes '' | apt-get install nginx -y + || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; }; \ + echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bullseye nginx" > /etc/apt/sources.list.d/nginx.list; \ + apt-get update; \ + apt-get install -y curl gnupg2 nano nginx RUN rm -f /etc/nginx/conf.d/default.conf \ && mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled COPY images/runtime/php-fpm/nginx_conf/default.conf /etc/nginx/sites-available/default @@ -495,48 +499,20 @@ RUN apt-mark hold msodbcsql17 msodbcsql18 odbcinst1debian2 odbcinst unixodbc uni && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h RUN set -eux; \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ # From php 8.4 version imap is removed from php core and moved to pecl - # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ - - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ + && docker-php-source extract \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ - && docker-php-source delete + && docker-php-source delete \ + && docker-php-ext-enable gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip bcmath \ + pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem sysvshm pdo_odbc xsl RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 From 1586aaa0c40da204dd406fbc7eab4a3d93f1097d Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Sat, 14 Nov 2026 15:02:42 +0530 Subject: [PATCH 15/21] Retry transient Azure Linux certificate feed connections Share bounded connection-only retries across active runtime certificate stages while preserving signed package and trust-store behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 4 +++ .../runtime/dotnetcore/10.0/noble.Dockerfile | 6 ++--- .../dotnetcore/11.0/resolute.Dockerfile | 6 ++--- .../dotnetcore/8.0/bookworm.Dockerfile | 6 ++--- .../dotnetcore/8.0/bullseye.Dockerfile | 6 ++--- .../dotnetcore/9.0/bookworm.Dockerfile | 6 ++--- images/runtime/node/20/bookworm.Dockerfile | 6 ++--- images/runtime/node/20/bullseye.Dockerfile | 6 ++--- images/runtime/node/22/bookworm.Dockerfile | 6 ++--- images/runtime/node/22/bullseye.Dockerfile | 6 ++--- images/runtime/node/24/noble.Dockerfile | 6 ++--- images/runtime/node/26/resolute.Dockerfile | 6 ++--- .../runtime/php-fpm/8.1/bullseye.Dockerfile | 6 ++--- .../runtime/php-fpm/8.2/bookworm.Dockerfile | 6 ++--- .../runtime/php-fpm/8.2/bullseye.Dockerfile | 6 ++--- .../runtime/php-fpm/8.3/bookworm.Dockerfile | 6 ++--- .../runtime/php-fpm/8.3/bullseye.Dockerfile | 6 ++--- .../runtime/php-fpm/8.4/bookworm.Dockerfile | 6 ++--- .../runtime/php-fpm/8.4/bullseye.Dockerfile | 6 ++--- images/runtime/php-fpm/8.5/noble.Dockerfile | 6 ++--- images/runtime/php/8.2/bullseye.Dockerfile | 6 ++--- images/runtime/php/8.3/bookworm.Dockerfile | 6 ++--- images/runtime/python/noble.Dockerfile | 6 ++--- .../python/resolute-based/resolute.Dockerfile | 6 ++--- images/runtime/python/template.Dockerfile | 6 ++--- .../scripts/install-azurelinux-ca-packages.sh | 25 +++++++++++++++++++ 26 files changed, 77 insertions(+), 96 deletions(-) create mode 100644 images/runtime/scripts/install-azurelinux-ca-packages.sh diff --git a/README.md b/README.md index d7b2a18ea2..cae8f75e9d 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,10 @@ The .NET 8 Bullseye runtime uses the official Debian archive because Bullseye packages have moved off the live mirrors. APT signature, checksum, and metadata expiry verification remain enabled. +Azure Linux certificate-package retrieval retries only connection failures, +up to three attempts with bounded delays. Other errors and exhausted retries +remain fatal; repository signatures and certificate verification are unchanged. + PHP runtime builds configure and compile four independent bundled extensions concurrently, splitting make jobs between them. The existing extension installer then installs and enables the results serially to avoid shared-header races. diff --git a/images/runtime/dotnetcore/10.0/noble.Dockerfile b/images/runtime/dotnetcore/10.0/noble.Dockerfile index 79a0ddac67..c96b6af9ec 100644 --- a/images/runtime/dotnetcore/10.0/noble.Dockerfile +++ b/images/runtime/dotnetcore/10.0/noble.Dockerfile @@ -42,12 +42,10 @@ RUN chmod +x build.sh && ./build.sh dotnetcore /opt/startupcmdgen/startupcmdgen FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/ubuntu:noble diff --git a/images/runtime/dotnetcore/11.0/resolute.Dockerfile b/images/runtime/dotnetcore/11.0/resolute.Dockerfile index 880ed0d90d..4e4d7f03a6 100644 --- a/images/runtime/dotnetcore/11.0/resolute.Dockerfile +++ b/images/runtime/dotnetcore/11.0/resolute.Dockerfile @@ -41,12 +41,10 @@ RUN chmod +x build.sh && ./build.sh dotnetcore /opt/startupcmdgen/startupcmdgen FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/ubuntu:resolute diff --git a/images/runtime/dotnetcore/8.0/bookworm.Dockerfile b/images/runtime/dotnetcore/8.0/bookworm.Dockerfile index 69ea119cf2..33747168e4 100644 --- a/images/runtime/dotnetcore/8.0/bookworm.Dockerfile +++ b/images/runtime/dotnetcore/8.0/bookworm.Dockerfile @@ -42,12 +42,10 @@ RUN chmod +x build.sh && ./build.sh dotnetcore /opt/startupcmdgen/startupcmdgen FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/debian:bookworm-slim diff --git a/images/runtime/dotnetcore/8.0/bullseye.Dockerfile b/images/runtime/dotnetcore/8.0/bullseye.Dockerfile index 502da1c9b8..97824e382a 100644 --- a/images/runtime/dotnetcore/8.0/bullseye.Dockerfile +++ b/images/runtime/dotnetcore/8.0/bullseye.Dockerfile @@ -42,12 +42,10 @@ RUN chmod +x build.sh && ./build.sh dotnetcore /opt/startupcmdgen/startupcmdgen FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/debian:bullseye-slim diff --git a/images/runtime/dotnetcore/9.0/bookworm.Dockerfile b/images/runtime/dotnetcore/9.0/bookworm.Dockerfile index 345d14342e..6c7b73b02c 100644 --- a/images/runtime/dotnetcore/9.0/bookworm.Dockerfile +++ b/images/runtime/dotnetcore/9.0/bookworm.Dockerfile @@ -42,12 +42,10 @@ RUN chmod +x build.sh && ./build.sh dotnetcore /opt/startupcmdgen/startupcmdgen FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/debian:bookworm-slim diff --git a/images/runtime/node/20/bookworm.Dockerfile b/images/runtime/node/20/bookworm.Dockerfile index 3206aefb6f..0da5d6705b 100644 --- a/images/runtime/node/20/bookworm.Dockerfile +++ b/images/runtime/node/20/bookworm.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/node/20/bullseye.Dockerfile b/images/runtime/node/20/bullseye.Dockerfile index 1dd91e2bda..8ab95e4877 100644 --- a/images/runtime/node/20/bullseye.Dockerfile +++ b/images/runtime/node/20/bullseye.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/node/22/bookworm.Dockerfile b/images/runtime/node/22/bookworm.Dockerfile index 53db7ab7cf..6db1b15401 100644 --- a/images/runtime/node/22/bookworm.Dockerfile +++ b/images/runtime/node/22/bookworm.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/node/22/bullseye.Dockerfile b/images/runtime/node/22/bullseye.Dockerfile index 5dd4dd125e..8c1c0e84aa 100644 --- a/images/runtime/node/22/bullseye.Dockerfile +++ b/images/runtime/node/22/bullseye.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/node/24/noble.Dockerfile b/images/runtime/node/24/noble.Dockerfile index 55714c2e1e..c258fb4251 100644 --- a/images/runtime/node/24/noble.Dockerfile +++ b/images/runtime/node/24/noble.Dockerfile @@ -8,12 +8,10 @@ ARG FEED_ACCESSTOKEN FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/node/26/resolute.Dockerfile b/images/runtime/node/26/resolute.Dockerfile index 3030622a34..48250b1e1c 100644 --- a/images/runtime/node/26/resolute.Dockerfile +++ b/images/runtime/node/26/resolute.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index aa9702769e..6c6cdb88c5 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 9c171665d4..e5066c1d48 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 44cf9f78ca..2e9ff3ead1 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 621c95bd33..13e819f043 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index a1cdf11c65..51dad53b53 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 28529e815b..406979b19e 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index ce3d36f878..6c5621df0b 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index a8f534b940..147e49f7b2 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index 8534aa07ad..a86a36ad24 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 3ebd360e9d..271f520fc9 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_run_base diff --git a/images/runtime/python/noble.Dockerfile b/images/runtime/python/noble.Dockerfile index ed76b2ece3..a773e3effb 100644 --- a/images/runtime/python/noble.Dockerfile +++ b/images/runtime/python/noble.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base diff --git a/images/runtime/python/resolute-based/resolute.Dockerfile b/images/runtime/python/resolute-based/resolute.Dockerfile index 0c33b05136..4047c0d68c 100644 --- a/images/runtime/python/resolute-based/resolute.Dockerfile +++ b/images/runtime/python/resolute-based/resolute.Dockerfile @@ -7,12 +7,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base diff --git a/images/runtime/python/template.Dockerfile b/images/runtime/python/template.Dockerfile index 1f0707278e..e4f5cfc81c 100644 --- a/images/runtime/python/template.Dockerfile +++ b/images/runtime/python/template.Dockerfile @@ -8,12 +8,10 @@ ARG INCLUDE_AZURELINUX_CERTS=true FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS azurelinux-core ARG INCLUDE_AZURELINUX_CERTS COPY images/runtime/certs/blocklist/ /etc/pki/ca-trust/source/blacklist/ +COPY images/runtime/scripts/install-azurelinux-ca-packages.sh /usr/local/bin/ RUN if [ "$(printf '%s' "$INCLUDE_AZURELINUX_CERTS" | tr '[:upper:]' '[:lower:]')" = "true" ]; then \ set -eux; \ - tdnf makecache; \ - tdnf install -y ca-certificates; \ - update-ca-trust extract; \ - tdnf clean all; \ + sh /usr/local/bin/install-azurelinux-ca-packages.sh; \ fi FROM mcr.microsoft.com/mirror/docker/library/${OS_TYPE}:${OS_FLAVOR} AS oryx_runtime_base diff --git a/images/runtime/scripts/install-azurelinux-ca-packages.sh b/images/runtime/scripts/install-azurelinux-ca-packages.sh new file mode 100644 index 0000000000..5462db7ba5 --- /dev/null +++ b/images/runtime/scripts/install-azurelinux-ca-packages.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -eu + +retry_tdnf() { + for attempt in 1 2 3; do + if tdnf "$@"; then + return 0 + else + status=$? + fi + # tdnf connection error 1208 is returned as shell exit status 184. + if [ "$status" -ne 184 ] || [ "$attempt" -eq 3 ]; then + return "$status" + fi + delay=$((attempt * 2)) + printf 'tdnf %s failed to connect (attempt %s/3); retrying in %s seconds.\n' \ + "$*" "$attempt" "$delay" >&2 + sleep "$delay" + done +} + +retry_tdnf makecache +retry_tdnf install -y ca-certificates +update-ca-trust extract +tdnf clean all From 949bad34cde1d23e610b6c77574eaf1824f4a71a Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Sat, 14 Nov 2026 15:31:49 +0530 Subject: [PATCH 16/21] Reduce Bookworm PHP configure work and CA metadata downloads Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 5 ++ .../runtime/php-fpm/8.3/bookworm.Dockerfile | 46 ++++++---------- .../runtime/php-fpm/8.4/bookworm.Dockerfile | 52 ++++++------------- images/runtime/php/8.3/bookworm.Dockerfile | 47 ++++++----------- .../scripts/install-azurelinux-ca-packages.sh | 4 +- 5 files changed, 53 insertions(+), 101 deletions(-) diff --git a/README.md b/README.md index cae8f75e9d..d142ef1a29 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,8 @@ expiry verification remain enabled. Azure Linux certificate-package retrieval retries only connection failures, up to three attempts with bounded delays. Other errors and exhausted retries remain fatal; repository signatures and certificate verification are unchanged. +Acquisition uses the existing official base repository that supplies these +packages, avoiding metadata downloads for unrelated Azure Linux repositories. PHP runtime builds configure and compile four independent bundled extensions concurrently, splitting make jobs between them. The existing extension installer @@ -177,6 +179,9 @@ the interpreter. PDO, PDO_MYSQL, mbstring, and sockets retain their standalone profiles; PHP 8.3 also builds bundled IMAP separately, while PHP 8.4 retains external PECL IMAP. Their module enablement and non-stripping behavior remain unchanged, as does the separate ODBC build. +The Bookworm PHP 8.3 Apache and PHP 8.3/8.4 FPM recipes use the same shared-module +partition while preserving their existing SAPI flags, standalone profiles, +module enablement, and non-stripping behavior. PHP 8.5 FPM builds compile 21 bundled shared modules with the interpreter. PDO, PDO_MYSQL, and sockets retain their standalone profiles; built-in OPcache, external PECL IMAP, and the separate ODBC build remain unchanged. diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 13e819f043..3ef85cb504 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -332,6 +332,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -489,45 +499,19 @@ RUN apt-mark hold msodbcsql17 msodbcsql18 odbcinst1debian2 odbcinst unixodbc uni && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h RUN set -eux; \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ imap \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ + && docker-php-ext-enable gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip \ + bcmath pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem \ + sysvshm pdo_odbc xsl \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 406979b19e..1b0d410e72 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -332,6 +332,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -489,49 +499,19 @@ RUN apt-mark hold msodbcsql17 msodbcsql18 odbcinst1debian2 odbcinst unixodbc uni && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h RUN set -eux; \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - # From php 8.4 version imap is removed from php core and moved to pecl - # && PHP_OPENSSL=yes \docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ - -#33 2.797 bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv intl json ldap mbstring mysqli odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip - - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ + && docker-php-source extract \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ + && docker-php-ext-enable gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip \ + bcmath pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem \ + sysvshm pdo_odbc xsl \ && docker-php-source delete RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 271f520fc9..8a36a99d78 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -380,6 +380,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -474,50 +484,23 @@ RUN apt-mark hold msodbcsql17 msodbcsql18 odbcinst1debian2 odbcinst unixodbc uni RUN set -eux; \ if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ + PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ else \ docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ fi \ - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ imap \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# wddx \ -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ + && docker-php-ext-enable gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip \ + bcmath pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem \ + sysvshm pdo_odbc xsl \ && docker-php-source delete RUN set -eux; \ diff --git a/images/runtime/scripts/install-azurelinux-ca-packages.sh b/images/runtime/scripts/install-azurelinux-ca-packages.sh index 5462db7ba5..669cea6493 100644 --- a/images/runtime/scripts/install-azurelinux-ca-packages.sh +++ b/images/runtime/scripts/install-azurelinux-ca-packages.sh @@ -19,7 +19,7 @@ retry_tdnf() { done } -retry_tdnf makecache -retry_tdnf install -y ca-certificates +retry_tdnf makecache '--disablerepo=*' --enablerepo=azurelinux-official-base +retry_tdnf install -y ca-certificates '--disablerepo=*' --enablerepo=azurelinux-official-base update-ca-trust extract tdnf clean all From 44ede19d19b8d3273145c019540484305fa37490 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Mon, 16 Nov 2026 11:08:46 +0530 Subject: [PATCH 17/21] Reduce repeated PHP package setup and certificate inspection Compile PHP 8.1 shared modules with the interpreter while retaining standalone profiles and non-stripping behavior. Reuse Bookworm APT indexes and group FPM Nginx setup. Inspect certificate metadata with bounded workers while retaining ordered import semantics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 21 ++++--- .../runtime/php-fpm/8.1/bullseye.Dockerfile | 56 ++++++----------- .../runtime/php-fpm/8.3/bookworm.Dockerfile | 22 +++---- .../runtime/php-fpm/8.4/bookworm.Dockerfile | 22 +++---- images/runtime/php/8.3/bookworm.Dockerfile | 7 +-- .../scripts/install-azurelinux-certs.sh | 61 +++++++++++++++---- 6 files changed, 99 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index d142ef1a29..9a35b8f466 100644 --- a/README.md +++ b/README.md @@ -165,15 +165,19 @@ up to three attempts with bounded delays. Other errors and exhausted retries remain fatal; repository signatures and certificate verification are unchanged. Acquisition uses the existing official base repository that supplies these packages, avoiding metadata downloads for unrelated Azure Linux repositories. +OpenSSL certificate metadata inspection uses at most four workers; deduplication, +filename selection, installation, and import diagnostics retain their original +order. The final trust-store refresh is unchanged. PHP runtime builds configure and compile four independent bundled extensions concurrently, splitting make jobs between them. The existing extension installer then installs and enables the results serially to avoid shared-header races. -PHP 8.2 FPM builds compile 22 bundled shared modules with the interpreter, avoiding -repeated configure work. PDO, mbstring, IMAP, PDO_MYSQL, and sockets retain their -standalone build profiles; merging those profiles can change library detection, -default socket settings, or exposed constants. The jointly built modules are -stripped and enabled with the existing helpers, preserving the module inventory. +PHP 8.1 FPM Bullseye and PHP 8.2 FPM builds compile 22 bundled shared modules with +the interpreter, avoiding repeated configure work. PDO, mbstring, IMAP, PDO_MYSQL, +and sockets retain their standalone build profiles; merging those profiles can +change library detection, default socket settings, or exposed constants. The +jointly built modules retain PHP 8.1's non-stripping and PHP 8.2's stripping +behavior and use the existing enablement helpers, preserving the module inventory. PHP 8.3 and 8.4 FPM Bullseye builds also compile 22 bundled shared modules with the interpreter. PDO, PDO_MYSQL, mbstring, and sockets retain their standalone profiles; PHP 8.3 also builds bundled IMAP separately, while PHP 8.4 retains @@ -185,9 +189,10 @@ module enablement, and non-stripping behavior. PHP 8.5 FPM builds compile 21 bundled shared modules with the interpreter. PDO, PDO_MYSQL, and sockets retain their standalone profiles; built-in OPcache, external PECL IMAP, and the separate ODBC build remain unchanged. -PHP 8.2 FPM Bookworm and PHP 8.3/8.4 FPM Bullseye reuse fresh APT indexes for the -persistent-dependency upgrade and group Nginx repository setup and package -installation. They avoid the adjacent duplicate extension-phase upgrade; +PHP 8.2 FPM Bookworm, PHP 8.3/8.4 FPM Bullseye and Bookworm, and PHP 8.3 Apache +Bookworm reuse fresh APT indexes for the persistent-dependency upgrade. +These FPM recipes also group Nginx repository setup and package installation. +PHP 8.2 FPM Bookworm and PHP 8.3/8.4 FPM Bullseye avoid the adjacent duplicate extension-phase upgrade; package upgrades, ODBC holds, and Nginx signing-key verification remain enabled. PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 6c6cdb88c5..25eca7c439 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -324,6 +324,16 @@ RUN set -eux; \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ + --enable-gd=shared --with-freetype --with-jpeg \ + --with-mysqli=shared --enable-opcache=shared \ + --with-pdo-pgsql=shared --with-pgsql=shared \ + --with-ldap=shared --enable-intl=shared --with-gmp=shared \ + --with-zip=shared --enable-bcmath=shared --enable-pcntl=shared \ + --enable-calendar=shared --enable-exif=shared --with-gettext=shared \ + --with-tidy=shared --enable-shmop=shared --enable-soap=shared \ + --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared \ + --with-pdo-odbc=shared,unixODBC,/usr --with-xsl=shared \ + \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ @@ -484,51 +494,23 @@ RUN apt-mark hold msodbcsql17 msodbcsql18 odbcinst1debian2 odbcinst unixodbc uni && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h RUN set -eux; \ - if [[ $PHP_VERSION == 7.4.* || $PHP_VERSION == 8.0.* || $PHP_VERSION == 8.1.* || $PHP_VERSION == 8.2.* || $PHP_VERSION == 8.3.* ]]; then \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - else \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl ; \ - fi \ - && docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ - && set -- gd \ - mysqli \ - opcache \ - pdo \ + apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends apache2-dev \ + && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && set -- pdo \ pdo_mysql \ - pdo_pgsql \ - pgsql \ - ldap \ - intl \ - gmp \ - zip \ - bcmath \ mbstring \ - pcntl \ - calendar \ - exif \ - gettext \ imap \ - tidy \ - shmop \ - soap \ sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - pdo_odbc \ -# deprecated from 7.4, so should be avoided in general template for all php versions -# xmlrpc \ - xsl \ && printf '%s\n' "$@" | xargs -r -n1 -P4 sh -ec \ 'cd "/usr/src/php/ext/$2"; [ -e Makefile ] || docker-php-ext-configure "$2"; make -j"$1"' \ -- "$(( ($(nproc) + 3) / 4 ))" \ && docker-php-ext-install -j "$(nproc)" "$@" \ - && docker-php-source delete + && docker-php-source delete \ + && set -- gd mysqli opcache pdo_pgsql pgsql ldap intl gmp zip bcmath \ + pcntl calendar exif gettext tidy shmop soap sysvmsg sysvsem sysvshm pdo_odbc xsl \ + && docker-php-ext-enable "$@" RUN MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" redis && docker-php-ext-enable redis # https://github.com/Imagick/imagick/issues/331 diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 3ef85cb504..61228e828e 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -141,14 +141,9 @@ RUN set -eux; \ apache2-dev \ libsqlite3-dev \ ; \ + ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && ACCEPT_EULA=Y \ - DEBIAN_FRONTEND=noninteractive \ - apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -442,16 +437,15 @@ ENV NGINX_RUN_USER www-data # Edit the default DocumentRoot setting ENV NGINX_DOCUMENT_ROOT /home/site/wwwroot # Install NGINX version from official nginx.org repository -RUN apt-get update -RUN apt install curl gnupg2 nano -y -RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg \ - && gpg --no-default-keyring \ +RUN set -euxo pipefail; \ + curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg; \ + gpg --no-default-keyring \ --keyring /usr/share/keyrings/nginx-archive-keyring.gpg \ --list-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ - || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; } \ - && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bookworm nginx" > /etc/apt/sources.list.d/nginx.list -RUN apt-get update -RUN yes '' | apt-get install nginx -y + || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; }; \ + echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bookworm nginx" > /etc/apt/sources.list.d/nginx.list; \ + apt-get update; \ + apt-get install -y curl gnupg2 nano nginx RUN rm -f /etc/nginx/conf.d/default.conf \ && mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled COPY images/runtime/php-fpm/nginx_conf/default.conf /etc/nginx/sites-available/default diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 1b0d410e72..723ebe4c8d 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -141,14 +141,9 @@ RUN set -eux; \ apache2-dev \ libsqlite3-dev \ ; \ + ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && ACCEPT_EULA=Y \ - DEBIAN_FRONTEND=noninteractive \ - apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -442,16 +437,15 @@ ENV NGINX_RUN_USER www-data # Edit the default DocumentRoot setting ENV NGINX_DOCUMENT_ROOT /home/site/wwwroot # Install NGINX version from official nginx.org repository -RUN apt-get update -RUN apt install curl gnupg2 nano -y -RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg \ - && gpg --no-default-keyring \ +RUN set -euxo pipefail; \ + curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg; \ + gpg --no-default-keyring \ --keyring /usr/share/keyrings/nginx-archive-keyring.gpg \ --list-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ - || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; } \ - && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bookworm nginx" > /etc/apt/sources.list.d/nginx.list -RUN apt-get update -RUN yes '' | apt-get install nginx -y + || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; }; \ + echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/debian bookworm nginx" > /etc/apt/sources.list.d/nginx.list; \ + apt-get update; \ + apt-get install -y curl gnupg2 nano nginx RUN rm -f /etc/nginx/conf.d/default.conf \ && mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled COPY images/runtime/php-fpm/nginx_conf/default.conf /etc/nginx/sites-available/default diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 8a36a99d78..69429f5c57 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -138,14 +138,9 @@ RUN set -eux; \ apache2-dev \ libsqlite3-dev \ ; \ + ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && ACCEPT_EULA=Y \ - DEBIAN_FRONTEND=noninteractive \ - apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen diff --git a/images/runtime/scripts/install-azurelinux-certs.sh b/images/runtime/scripts/install-azurelinux-certs.sh index f923dba1e7..8ce6ed4b30 100644 --- a/images/runtime/scripts/install-azurelinux-certs.sh +++ b/images/runtime/scripts/install-azurelinux-certs.sh @@ -61,21 +61,36 @@ sanitize_filename() { tr '[:space:]/,()' '_' | tr -cd 'A-Za-z0-9_.-' | tr -s '_.-' | sed -E 's/^[_.-]+//; s/[_.-]+$//' | cut -c1-60 } -fingerprint_sha256() { - local fingerprint - fingerprint=$(openssl x509 -in "$1" -noout -fingerprint -sha256) || return 1 - printf '%s\n' "${fingerprint#*=}" +prepare_certificate_metadata() { + local metadata_dir="$1" + shift + mkdir -p "$metadata_dir" || return 1 + [ "$#" -gt 0 ] || return 0 + + # Inspect independently; consume results in original order below. + printf '%s\0' "$@" | xargs -0 -r -n16 -P4 bash -ec ' + metadata_dir="$1" + shift + for certificate; do + output="$metadata_dir/${certificate##*/}" + status=0 + openssl x509 -in "$certificate" -noout -subject -nameopt RFC2253 -fingerprint -sha256 \ + > "$output.txt" 2> "$output.stderr" || status=$? + printf "%s\n" "$status" > "$output.status" + done + ' -- "$metadata_dir" } process_certificate() { local azlCert="$1" dest_dir="$2" idx="$3" local metadata fp="" subject="" line - # Validate and read both fields in one OpenSSL invocation. - if ! metadata=$(openssl x509 -in "$azlCert" -noout -subject -nameopt RFC2253 -fingerprint -sha256 2>/dev/null); then + local metadata_path="$TMP_CERTS_DIR/bundle-metadata/${azlCert##*/}" + if [ "$(< "$metadata_path.status")" != 0 ]; then err "Invalid cert: $azlCert" return 1 fi + metadata=$(< "$metadata_path.txt") while IFS= read -r line; do case "$line" in subject=*) subject="$line" ;; @@ -124,12 +139,28 @@ process_certificate() { } extract_system_fingerprints() { + local existing line metadata_path + local -a certificates=() if [ -d "/etc/ssl/certs" ]; then - for existing in /etc/ssl/certs/*.pem; do [ -f "$existing" ] || continue - fp_sys=$(fingerprint_sha256 "$existing") || true - [ -n "${fp_sys:-}" ] && printf '%s\n' "$fp_sys" >> "$TMP_CERTS_DIR/system-fingerprints.txt" + certificates+=("$existing") + done + if ! prepare_certificate_metadata "$TMP_CERTS_DIR/system-metadata" "${certificates[@]}"; then + err "Failed to inspect system certificates." + return 1 + fi + for existing in "${certificates[@]}"; do + metadata_path="$TMP_CERTS_DIR/system-metadata/${existing##*/}" + if [ -s "$metadata_path.stderr" ]; then + cat "$metadata_path.stderr" >&2 + fi + [ "$(< "$metadata_path.status")" = 0 ] || continue + while IFS= read -r line; do + case "$line" in + *Fingerprint=*) printf '%s\n' "${line#*=}" >> "$TMP_CERTS_DIR/system-fingerprints.txt" ;; + esac + done < "$metadata_path.txt" done if [ -s "$TMP_CERTS_DIR/system-fingerprints.txt" ]; then @@ -177,11 +208,19 @@ main() { return 1 fi - local count=0 idx=0 + local count=0 idx=0 pem + local -a certificates=() : > "$TMP_CERTS_DIR/imported-azl-fingerprints.txt" - for pem in "$TMP_CERTS_DIR"/cert-*.pem; do [ -f "$pem" ] || continue + certificates+=("$pem") + done + if ! prepare_certificate_metadata "$TMP_CERTS_DIR/bundle-metadata" "${certificates[@]}"; then + err "Failed to inspect bundle certificates." + return 1 + fi + + for pem in "${certificates[@]}"; do idx=$((idx+1)) if process_certificate "$pem" "$DEST_DIR" "$idx"; then From 748ca2b7d441f08a0dbe785e9acf95b56b1be920 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Mon, 16 Nov 2026 11:56:09 +0530 Subject: [PATCH 18/21] Consolidate PHP 8.5 Noble package setup Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 6 +++-- images/runtime/php-fpm/8.5/noble.Dockerfile | 26 +++++++-------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 9a35b8f466..eda8a03590 100644 --- a/README.md +++ b/README.md @@ -190,9 +190,11 @@ PHP 8.5 FPM builds compile 21 bundled shared modules with the interpreter. PDO, PDO_MYSQL, and sockets retain their standalone profiles; built-in OPcache, external PECL IMAP, and the separate ODBC build remain unchanged. PHP 8.2 FPM Bookworm, PHP 8.3/8.4 FPM Bullseye and Bookworm, and PHP 8.3 Apache -Bookworm reuse fresh APT indexes for the persistent-dependency upgrade. +Bookworm, along with PHP 8.5 FPM Noble, reuse fresh APT indexes for the +persistent-dependency upgrade. These FPM recipes also group Nginx repository setup and package installation. -PHP 8.2 FPM Bookworm and PHP 8.3/8.4 FPM Bullseye avoid the adjacent duplicate extension-phase upgrade; +PHP 8.2 FPM Bookworm, PHP 8.3/8.4 FPM Bullseye, and PHP 8.5 FPM Noble avoid the +adjacent duplicate extension-phase upgrade; package upgrades, ODBC holds, and Nginx signing-key verification remain enabled. PECL receives command-scoped `MAKEFLAGS`, leaving the running image's environment and extension selection unchanged. diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 147e49f7b2..eb2048902a 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -141,14 +141,9 @@ RUN set -eux; \ apache2-dev \ libsqlite3-dev \ ; \ + ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && ACCEPT_EULA=Y \ - DEBIAN_FRONTEND=noninteractive \ - apt-get upgrade --assume-yes \ - && rm -rf /var/lib/apt/lists/* - # Startup script generator FROM mcr.microsoft.com/oss/go/microsoft/golang:1.26-bookworm as startupCmdGen @@ -442,16 +437,15 @@ ENV NGINX_RUN_USER=www-data # Edit the default DocumentRoot setting ENV NGINX_DOCUMENT_ROOT=/home/site/wwwroot # Install NGINX version from official nginx.org repository -RUN apt-get update -RUN apt install curl gnupg2 nano -y -RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg \ - && gpg --no-default-keyring \ +RUN set -euxo pipefail; \ + curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg; \ + gpg --no-default-keyring \ --keyring /usr/share/keyrings/nginx-archive-keyring.gpg \ --list-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ - || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; } \ - && echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/ubuntu noble nginx" > /etc/apt/sources.list.d/nginx.list -RUN apt-get update -RUN apt-get install -y nginx + || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; }; \ + echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/ubuntu noble nginx" > /etc/apt/sources.list.d/nginx.list; \ + apt-get update; \ + apt-get install -y curl gnupg2 nano nginx RUN rm -f /etc/nginx/conf.d/default.conf \ && mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled COPY images/runtime/php-fpm/nginx_conf/default.conf /etc/nginx/sites-available/default @@ -499,9 +493,7 @@ RUN apt-mark hold msodbcsql18 unixodbc unixodbc-dev \ && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h RUN set -eux; \ - apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends apache2-dev \ + apt-get install -y --no-install-recommends apache2-dev \ # IMAP is external from PHP 8.4 onward. && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ && docker-php-source extract \ From 5f66478ac536f71709691a443fc74fbb2a910e5f Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Mon, 16 Nov 2026 12:39:08 +0530 Subject: [PATCH 19/21] Use native Linux file installation for PHP runtimes Use coreutils install for the core installation instead of the process-heavy portable shell installer. Keep compilation and installed file contents, types, ownership, permissions and symlinks unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 2 ++ images/runtime/php-fpm/8.1/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.2/bookworm.Dockerfile | 2 +- images/runtime/php-fpm/8.2/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.3/bookworm.Dockerfile | 2 +- images/runtime/php-fpm/8.3/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.4/bookworm.Dockerfile | 2 +- images/runtime/php-fpm/8.4/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.5/noble.Dockerfile | 2 +- images/runtime/php/8.2/bullseye.Dockerfile | 2 +- images/runtime/php/8.3/bookworm.Dockerfile | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index eda8a03590..95bae0ae75 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,8 @@ order. The final trust-store refresh is unchanged. PHP runtime builds configure and compile four independent bundled extensions concurrently, splitting make jobs between them. The existing extension installer then installs and enables the results serially to avoid shared-header races. +The core installation uses native Linux `install` instead of PHP's portable +shell installer, preserving file contents and permissions without changing compilation. PHP 8.1 FPM Bullseye and PHP 8.2 FPM builds compile 22 bundled shared modules with the interpreter, avoiding repeated configure work. PDO, mbstring, IMAP, PDO_MYSQL, and sockets retain their standalone build profiles; merging those profiles can diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index 25eca7c439..bb081fa058 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -338,7 +338,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index e5066c1d48..63724e7af0 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -340,7 +340,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 2e9ff3ead1..7f70a0f5ca 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -353,7 +353,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index 61228e828e..a899bee68d 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -341,7 +341,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index 51dad53b53..f5a0f88a5e 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -343,7 +343,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 723ebe4c8d..7d4340f3c1 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -341,7 +341,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index 6c5621df0b..d0890d55a5 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -343,7 +343,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index eb2048902a..81b0877c45 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -340,7 +340,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index a86a36ad24..55a1efda04 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -384,7 +384,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index 69429f5c57..e753ea711f 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -389,7 +389,7 @@ RUN set -eux; \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ - make install; \ + make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ make clean; \ \ From f2d426d80cfb409cfa08a9b3dc4138aa79e7d17d Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Mon, 16 Nov 2026 14:03:54 +0530 Subject: [PATCH 20/21] Schedule expensive PHP compilation units earlier Keep all configured targets, compiler flags, dependencies and concurrency limits unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 3 +++ images/runtime/php-fpm/8.1/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.2/bookworm.Dockerfile | 2 +- images/runtime/php-fpm/8.2/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.3/bookworm.Dockerfile | 2 +- images/runtime/php-fpm/8.3/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.4/bookworm.Dockerfile | 2 +- images/runtime/php-fpm/8.4/bullseye.Dockerfile | 2 +- images/runtime/php-fpm/8.5/noble.Dockerfile | 2 +- images/runtime/php/8.2/bullseye.Dockerfile | 2 +- images/runtime/php/8.3/bookworm.Dockerfile | 2 +- images/runtime/php/build-order.mk | 5 +++++ 12 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 images/runtime/php/build-order.mk diff --git a/README.md b/README.md index 95bae0ae75..062dfc8e23 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,9 @@ order. The final trust-store refresh is unchanged. PHP runtime builds configure and compile four independent bundled extensions concurrently, splitting make jobs between them. The existing extension installer then installs and enables the results serially to avoid shared-header races. +Core compilation starts the Zend executor and configured JIT translation units +early in the same make dependency graph, retaining the complete `all` target, +compiler flags, and job limit. The core installation uses native Linux `install` instead of PHP's portable shell installer, preserving file contents and permissions without changing compilation. PHP 8.1 FPM Bullseye and PHP 8.2 FPM builds compile 22 bundled shared modules with diff --git a/images/runtime/php-fpm/8.1/bullseye.Dockerfile b/images/runtime/php-fpm/8.1/bullseye.Dockerfile index bb081fa058..a3d1c82482 100644 --- a/images/runtime/php-fpm/8.1/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.1/bullseye.Dockerfile @@ -336,7 +336,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php-fpm/8.2/bookworm.Dockerfile b/images/runtime/php-fpm/8.2/bookworm.Dockerfile index 63724e7af0..922c3053b5 100644 --- a/images/runtime/php-fpm/8.2/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.2/bookworm.Dockerfile @@ -338,7 +338,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php-fpm/8.2/bullseye.Dockerfile b/images/runtime/php-fpm/8.2/bullseye.Dockerfile index 7f70a0f5ca..d03e1e6bdd 100644 --- a/images/runtime/php-fpm/8.2/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.2/bullseye.Dockerfile @@ -351,7 +351,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php-fpm/8.3/bookworm.Dockerfile b/images/runtime/php-fpm/8.3/bookworm.Dockerfile index a899bee68d..6a0a46a0cc 100644 --- a/images/runtime/php-fpm/8.3/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.3/bookworm.Dockerfile @@ -339,7 +339,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php-fpm/8.3/bullseye.Dockerfile b/images/runtime/php-fpm/8.3/bullseye.Dockerfile index f5a0f88a5e..380df2f4a5 100644 --- a/images/runtime/php-fpm/8.3/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.3/bullseye.Dockerfile @@ -341,7 +341,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php-fpm/8.4/bookworm.Dockerfile b/images/runtime/php-fpm/8.4/bookworm.Dockerfile index 7d4340f3c1..a3e1335dea 100644 --- a/images/runtime/php-fpm/8.4/bookworm.Dockerfile +++ b/images/runtime/php-fpm/8.4/bookworm.Dockerfile @@ -339,7 +339,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php-fpm/8.4/bullseye.Dockerfile b/images/runtime/php-fpm/8.4/bullseye.Dockerfile index d0890d55a5..78ffd88369 100644 --- a/images/runtime/php-fpm/8.4/bullseye.Dockerfile +++ b/images/runtime/php-fpm/8.4/bullseye.Dockerfile @@ -341,7 +341,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 81b0877c45..0f021fddb4 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -338,7 +338,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php/8.2/bullseye.Dockerfile b/images/runtime/php/8.2/bullseye.Dockerfile index 55a1efda04..9075058dd2 100644 --- a/images/runtime/php/8.2/bullseye.Dockerfile +++ b/images/runtime/php/8.2/bullseye.Dockerfile @@ -382,7 +382,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php/8.3/bookworm.Dockerfile b/images/runtime/php/8.3/bookworm.Dockerfile index e753ea711f..65ff66b0f1 100644 --- a/images/runtime/php/8.3/bookworm.Dockerfile +++ b/images/runtime/php/8.3/bookworm.Dockerfile @@ -387,7 +387,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ + make -f Makefile -f "${IMAGES_DIR}/runtime/php/build-order.mk" -j "$(nproc)" oryx-runtime; \ find -type f -name '*.a' -delete; \ make install INSTALL="install -c"; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ diff --git a/images/runtime/php/build-order.mk b/images/runtime/php/build-order.mk new file mode 100644 index 0000000000..16c1d10632 --- /dev/null +++ b/images/runtime/php/build-order.mk @@ -0,0 +1,5 @@ +# Start the longest translation units early, using only configured JIT objects. +.PHONY: oryx-runtime +oryx-runtime: Zend/zend_execute.lo \ + $(filter ext/opcache/jit/zend_jit.lo ext/opcache/jit/ir/ir.lo ext/opcache/jit/ir/ir_emit.lo,$(PHP_GLOBAL_OBJS) $(shared_objects_opcache)) \ + all From 6b01fec9c1aae335eb43356eb8b37bd7d1b8cae1 Mon Sep 17 00:00:00 2001 From: Priya Chintalapati Date: Mon, 16 Nov 2026 14:44:36 +0530 Subject: [PATCH 21/21] Avoid retained APT index layers in PHP Noble runtime Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 3 + images/runtime/php-fpm/8.5/noble.Dockerfile | 74 +++++++++------------ 2 files changed, 35 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 062dfc8e23..2fd270e2ff 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,9 @@ module enablement, and non-stripping behavior. PHP 8.5 FPM builds compile 21 bundled shared modules with the interpreter. PDO, PDO_MYSQL, and sockets retain their standalone profiles; built-in OPcache, external PECL IMAP, and the separate ODBC build remain unchanged. +Its Noble recipe installs core headers with the persistent dependencies and +cleans APT indexes before committing package layers, retaining package marks +and ODBC holds while avoiding redundant metadata refreshes and deleted index blobs. PHP 8.2 FPM Bookworm, PHP 8.3/8.4 FPM Bullseye and Bookworm, and PHP 8.3 Apache Bookworm, along with PHP 8.5 FPM Noble, reuse fresh APT indexes for the persistent-dependency upgrade. diff --git a/images/runtime/php-fpm/8.5/noble.Dockerfile b/images/runtime/php-fpm/8.5/noble.Dockerfile index 0f021fddb4..f08fb5153d 100644 --- a/images/runtime/php-fpm/8.5/noble.Dockerfile +++ b/images/runtime/php-fpm/8.5/noble.Dockerfile @@ -27,30 +27,28 @@ RUN if [ "${OS_FLAVOR}" = "bullseye" ]; then \ /usr/local/bin/configure-debian-bullseye-snapshot.sh; \ fi -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ +RUN set -eux; \ + apt-get update; \ + apt-get upgrade -y; \ + apt-get install -y --no-install-recommends \ xz-utils \ ca-certificates \ curl \ gnupg \ netbase \ - wget - -RUN if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ + wget; \ + if [ "${OS_FLAVOR}" = "bullseye" ] || [ "${OS_FLAVOR}" = "bookworm" ]; then \ chmod +x /usr/local/bin/install-debian-tzdata-2026e.sh; \ /usr/local/bin/install-debian-tzdata-2026e.sh; \ elif [ "${OS_FLAVOR}" = "noble" ] || [ "${OS_FLAVOR}" = "resolute" ]; then \ - apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata; \ - fi - -RUN if [ "${OS_FLAVOR}" = "bookworm" ] ; then \ - apt-get update && apt-get install -y --no-install-recommends sq ; \ - fi - -RUN rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh \ - && rm -rf /var/lib/apt/lists/* + fi; \ + if [ "${OS_FLAVOR}" = "bookworm" ]; then \ + apt-get update; \ + apt-get install -y --no-install-recommends sq; \ + fi; \ + rm -f /usr/local/bin/configure-debian-bullseye-snapshot.sh /usr/local/bin/install-debian-tzdata-2026e.sh; \ + rm -rf /var/lib/apt/lists/* # Copy Azure linux certs to a temporary location RUN mkdir -p /tmp/azurelinux-ca-certs && \ @@ -140,7 +138,12 @@ RUN set -eux; \ zlib1g-dev \ apache2-dev \ libsqlite3-dev \ + libargon2-dev \ + libssl-dev \ + libxml2-dev \ ; \ + # These core build dependencies were previously installed as automatic packages. + apt-mark auto libargon2-dev libssl-dev libxml2-dev; \ ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --assume-yes; \ rm -rf /var/lib/apt/lists/* @@ -174,7 +177,8 @@ RUN set -eux \ && curl https://packages.microsoft.com/config/ubuntu/24.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \ && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \ && apt-get update \ - && ACCEPT_EULA=Y apt-get install -y msodbcsql18=18.6.1.1-1 libodbcinst2=2.3.12-1ubuntu0.24.04.1 odbcinst=2.3.12-1ubuntu0.24.04.1 unixodbc=2.3.12-1ubuntu0.24.04.1 unixodbc-dev=2.3.12-1ubuntu0.24.04.1 + && ACCEPT_EULA=Y apt-get install -y msodbcsql18=18.6.1.1-1 libodbcinst2=2.3.12-1ubuntu0.24.04.1 odbcinst=2.3.12-1ubuntu0.24.04.1 unixodbc=2.3.12-1ubuntu0.24.04.1 unixodbc-dev=2.3.12-1ubuntu0.24.04.1 \ + && rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR=/usr/local/etc/php RUN set -eux; \ @@ -213,9 +217,6 @@ ENV PHP_SOURCE_BASE_URL=${PHP_SOURCE_BASE_URL} RUN set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -256,20 +257,11 @@ RUN set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libonig-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ + if [ -n "${PHP_EXTRA_BUILD_DEPS:-}" ]; then \ + apt-get update; \ + apt-get install -y --no-install-recommends $PHP_EXTRA_BUILD_DEPS; \ + rm -rf /var/lib/apt/lists/*; \ + fi; \ \ export \ CFLAGS="$PHP_CFLAGS" \ @@ -445,7 +437,10 @@ RUN set -euxo pipefail; \ || { echo "ERROR: nginx signing key fingerprint mismatch"; exit 1; }; \ echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://nginx.org/packages/ubuntu noble nginx" > /etc/apt/sources.list.d/nginx.list; \ apt-get update; \ - apt-get install -y curl gnupg2 nano nginx + apt-get install -y curl gnupg2 nano nginx; \ + apt-mark hold msodbcsql18 unixodbc unixodbc-dev; \ + apt-get upgrade -y; \ + rm -rf /var/lib/apt/lists/* RUN rm -f /etc/nginx/conf.d/default.conf \ && mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled COPY images/runtime/php-fpm/nginx_conf/default.conf /etc/nginx/sites-available/default @@ -484,18 +479,13 @@ RUN nginx -t ENV NGINX_PORT=8080 # Install common PHP extensions -# TEMPORARY: Holding odbc related packages from upgrading. -RUN apt-mark hold msodbcsql18 unixodbc unixodbc-dev \ - && apt-get update \ - && apt-get upgrade -y \ - && ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ +RUN ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \ && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h +# IMAP is external from PHP 8.4 onward. RUN set -eux; \ - apt-get install -y --no-install-recommends apache2-dev \ - # IMAP is external from PHP 8.4 onward. - && MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ + MAKEFLAGS="-j$(nproc)" "${IMAGES_DIR}/runtime/php/install-pecl.sh" imap \ && docker-php-source extract \ && set -- pdo \ pdo_mysql \