Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
519af32
Inline bases into active runtime Dockerfiles
Saipriya-1144 Nov 12, 2026
20d44ce
Use signed Debian archive for .NET 8 Bullseye packages
Saipriya-1144 Nov 12, 2026
762d56f
Avoid serial PHP extension builds and unused Python runtime archives
Saipriya-1144 Nov 12, 2026
79af2fb
Parallelize PECL builds in runtime images
Saipriya-1144 Nov 13, 2026
0a200bb
Parallelize Python LTO links and clean PHP sources within build layers
Saipriya-1144 Nov 13, 2026
6f9c0a1
Parallelize older Python LTO partitions and full PGO training
Saipriya-1144 Nov 13, 2026
597e747
Stop redundant GPG key retries after recovery
Saipriya-1144 Nov 13, 2026
e4ad8b1
Compile bundled PHP extensions concurrently before installation
Saipriya-1144 Nov 13, 2026
7df6310
Reduce temporary Python training work and overlap runtime dependencies
Saipriya-1144 Nov 13, 2026
90a6da1
Retry transient PECL downloads without retrying native builds
Saipriya-1144 Nov 13, 2026
a06ed1b
Avoid parsing imported CA certificates repeatedly
Saipriya-1144 Nov 13, 2026
938a7bc
Compile PHP 8.2 FPM shared modules with the interpreter
Saipriya-1144 Nov 14, 2026
1502dda
Compile PHP 8.5 FPM bundled modules with the interpreter
Saipriya-1144 Nov 14, 2026
214a3cf
Reduce remaining PHP cold runtime build overhead
Saipriya-1144 Nov 14, 2026
1586aaa
Retry transient Azure Linux certificate feed connections
Saipriya-1144 Nov 14, 2026
949bad3
Reduce Bookworm PHP configure work and CA metadata downloads
Saipriya-1144 Nov 14, 2026
44ede19
Reduce repeated PHP package setup and certificate inspection
Saipriya-1144 Nov 16, 2026
748ca2b
Consolidate PHP 8.5 Noble package setup
Saipriya-1144 Nov 16, 2026
5f66478
Use native Linux file installation for PHP runtimes
Saipriya-1144 Nov 16, 2026
f2d426d
Schedule expensive PHP compilation units earlier
Saipriya-1144 Nov 16, 2026
6b01fec
Avoid retained APT index layers in PHP Noble runtime
Saipriya-1144 Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,85 @@ 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.

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.
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.
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
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
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.
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.
These FPM recipes also group Nginx repository setup and package installation.
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.
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`.
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
[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.
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
`build/testStartupScriptGenerators.sh` will perform tests on all startup script generators written in go.
Expand Down
7 changes: 6 additions & 1 deletion images/receiveGpgKeys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 2 additions & 4 deletions images/runtime/dotnetcore/10.0/noble.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions images/runtime/dotnetcore/11.0/resolute.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions images/runtime/dotnetcore/8.0/bookworm.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions images/runtime/dotnetcore/8.0/bullseye.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ 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
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 \
Expand Down
6 changes: 2 additions & 4 deletions images/runtime/dotnetcore/9.0/bookworm.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
110 changes: 106 additions & 4 deletions images/runtime/node/20/bookworm.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,107 @@
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/
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; \
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
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
Expand All @@ -15,7 +118,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 \
Expand All @@ -31,8 +134,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
Expand Down
Loading
Loading