Skip to content

distribution: Build the release container images with rules_oci - #49259

Merged
phlax merged 2 commits into
envoyproxy:mainfrom
phlax:distroless-rules-oci
Nov 16, 2026
Merged

phlax merged 2 commits into
envoyproxy:mainfrom
phlax:distroless-rules-oci

Conversation

@phlax

@phlax phlax commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Commit Message: distribution: Build the release container images with rules_oci
Additional Description:

Builds all of the release container images with bazel (rules_oci) instead of docker buildx: envoy, envoy-debug, envoy-contrib, envoy-contrib-debug, envoy-tools, envoy-distroless, envoy-contrib-distroless, matching the stages of Dockerfile-envoy.

  • Distroless images: the pinned distroless base, plus the config and binary layers.
  • Ubuntu images: the pinned ubuntu base (mirror.gcr.io, same digest as the Dockerfile), with ca-certificates, openssl and tzdata from a pinned snapshot.ubuntu.com timestamp (rules_distroless). The RUN steps of the envoy-base stage become layers:
    • oci_base_edit (toolshed, oci: Add oci_base_edit to add users and packages to a base image toolshed#5597): adds envoy to the base's passwd/group/shadow/gshadow as adduser --group --system envoy does (uid/gid 101), /home/envoy, and the packages to the dpkg status;
    • the package data, the CA bundle (cacerts), and /etc/timezone / /etc/localtime (Etc/UTC);
    • /etc/envoy/{envoy.yaml,VERSION.txt}, /docker-entrypoint.sh, su-exec, the binary (+ .dwp for debug), the tools for -tools; same entrypoint/cmd/env/port.
  • The binaries use the same opt/strip transition as the release bundle, so they come from the release build.
  • The debug layers are gzipped at level 1: their contents' debug sections are already compressed (distribution: Compress the release .dwps, and cache them in parts #49294, release/ci: Compress the debug sections of the released binaries #49295), which gzip barely shrinks.
  • release.publish strips the release binaries locally: the client downloads them anyway (the release tarball and images are built locally), while a remote strip waits on a worker fetching the freshly linked binary (~30s in envoy-ci-staging).

CI targets:

  • release.server: the release binaries and tools; release.server_only (used by the Publish workflow, and so by release branches) is the same, unchanged.
  • release.publish (new): as release.server, and the distro packages, and the images (//distribution/docker:images) as OCI tarballs (the image layout, as docker buildx -o type=oci writes it for a single platform) in the release binary directory.
  • docker is unchanged (buildx): where release-publish is set its job is skipped, as release.publish writes the images to build_images/<image>.<arch>.tar itself. Local loads and multi-platform builds still use it.

Publish switches to release.publish here: .github/config.yml sets release-publish: true, so each arch's binary job builds the release binaries, the images and the packages in one invocation and uploads them (release.<arch>, oci.<arch>, packages.<arch>), and the separate Docker OCI and Packages jobs are skipped. Branches without release-publish (the release branches) keep release.server_only and the separate jobs, with buildx.

Differences from the buildx images:

  • No apt-get upgrade: base packages are those of the pinned base until its digest (and the snapshot) is bumped.
  • Only the CA bundle in /etc/ssl/certs, not the per-certificate hash links.

This overrides envoy_toolshed with envoyproxy/toolshed#5597 (on the v0.5.20 release) until it is released; the docs/external jobs fail with the override ("Missing version info: envoy_toolshed").

Risk Level: medium (release container images)
Testing: envoy-ci-staging (release.publish in Publish; manifests, verify_distro, verify-distroless, examples use the images)
Docs Changes: n/a
Release Notes: n/a

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #49259 was opened by phlax.

see: more, trace.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new OCI tarball targets supply images instead of required image indexes, breaking both release targets, and the added build dependency lacks required metadata.

2 open issues
What changed in this PR

Moves Envoy’s standard and contrib distroless image builds toward Bazel, as a first step toward building release artifacts together per architecture.

Changes:

  • Adds rules_oci and a pinned distroless base, with updated dependency lockfiles.
  • Defines image layers and OCI tarball targets using release binaries and the default configuration.
  • Integrates tarball production and collection into CI, skipping equivalent buildx builds while preserving local-load and multi-platform paths.
File Description
MODULE.bazel.lock Records the new OCI dependency and transitive updates.
MODULE.bazel Adds rules_oci and the pinned distroless base.
mobile/​MODULE.bazel.lock Updates Mobile’s resolved dependency metadata.
docs/​MODULE.bazel.lock Updates documentation’s resolved dependency metadata.
distribution/​docker/​build.sh Allows buildx to skip distroless variants.
distribution/​docker/​BUILD Defines distroless image layers and tarball targets.
configs/​BUILD Exports the default configuration for image packaging.
ci/​do_ci.sh Builds and collects Bazel-produced image tarballs.
bazel/​tests/​external/​MODULE.bazel.lock Updates external-build dependency metadata.
bazel/​tests/​codeql/​MODULE.bazel.lock Updates CodeQL-build dependency metadata.

Review effort: Balanced

Comment thread distribution/docker/BUILD Resolved
Comment thread MODULE.bazel Resolved
@phlax
phlax force-pushed the distroless-rules-oci branch from 96a265e to fc6b27a Compare November 14, 2026 11:39
@phlax
phlax force-pushed the distroless-rules-oci branch 3 times, most recently from 14ffb70 to 2f6e14b Compare November 14, 2026 12:59
@phlax phlax changed the title [WIP] distribution: Build the distroless container images with rules_oci [WIP] distribution: Build the release container images with rules_oci Nov 14, 2026
@phlax
phlax force-pushed the distroless-rules-oci branch 5 times, most recently from d73f689 to 7ec9e4a Compare November 14, 2026 13:16
@phlax
phlax force-pushed the distroless-rules-oci branch 6 times, most recently from 7e1118b to 887df66 Compare November 14, 2026 15:42
@phlax
phlax force-pushed the distroless-rules-oci branch 4 times, most recently from 926528c to 69b0576 Compare November 14, 2026 17:39
@phlax
phlax force-pushed the distroless-rules-oci branch from 69b0576 to 28d9cbd Compare November 14, 2026 18:20
@phlax
phlax merged commit aa082aa into envoyproxy:main Nov 16, 2026
30 checks passed
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Signed-off-by: Ryan Northey <[email protected]>

Backport note (release/v1.40): the images are built from this branch's bases
(the `Dockerfile-envoy` digests: ubuntu 5ec03bb3, distroless 6a2a3346), the new
modules are added to this branch's pins (`rules_cc` 0.2.25, `rules_foreign_cc`
0.16.0, `su-exec` 0.3), and the lockfiles are regenerated.

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
)

The published container images are built with rules_oci
(`//distribution/docker`, #49259) from the base image digests pinned by
`oci.pull` in `MODULE.bazel` (`@ubuntu_base`, `@distroless_base_nossl`).
The `release-images` task (`ci/dependency/release_images.sh`, #49106)
only updated the same digests in `distribution/docker/Dockerfile-envoy`,
so since #49259 its bumps have not reached the published images.

The script now updates the digest in both files. It also fails if an
image's digest in the Dockerfile is not the one pinned in
`MODULE.bazel`, so the two can't drift apart unnoticed. The digests are
not recorded in `MODULE.bazel.lock`, so there is no lockfile change with
a bump.

The Dockerfile is still read for the pinned images and tags, and is
still what `distribution/docker/build.sh` builds from.

Risk Level: low (the dependency workflow's `release-images` task only)
Testing: ran the script against copies of the two files with a stubbed
`docker buildx imagetools inspect`: a bump updates both files, a rerun
reports up to date, and a digest that differs between the files fails.
shellcheck is clean. The workflow task itself has not been run with this
change.
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…oyproxy#49350)

The published container images are built with rules_oci
(`//distribution/docker`, envoyproxy#49259) from the base image digests pinned by
`oci.pull` in `MODULE.bazel` (`@ubuntu_base`, `@distroless_base_nossl`).
The `release-images` task (`ci/dependency/release_images.sh`, envoyproxy#49106)
only updated the same digests in `distribution/docker/Dockerfile-envoy`,
so since envoyproxy#49259 its bumps have not reached the published images.

The script now updates the digest in both files. It also fails if an
image's digest in the Dockerfile is not the one pinned in
`MODULE.bazel`, so the two can't drift apart unnoticed. The digests are
not recorded in `MODULE.bazel.lock`, so there is no lockfile change with
a bump.

The Dockerfile is still read for the pinned images and tags, and is
still what `distribution/docker/build.sh` builds from.

Risk Level: low (the dependency workflow's `release-images` task only)
Testing: ran the script against copies of the two files with a stubbed
`docker buildx imagetools inspect`: a bump updates both files, a rerun
reports up to date, and a digest that differs between the files fails.
shellcheck is clean. The workflow task itself has not been run with this
change.
Docs Changes: n/a
Release Notes: n/a

(cherry picked from commit 499b706)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
The debug images took the `.dwp`s as llvm-dwp writes them, with their
debug sections uncompressed (over 3GB for contrib, per arch), and each
as a single blob in the remote cache. The compressed `.dwp`s, cached in
parts (envoyproxy#49294), were only used by the release tarball, which the
images are no longer built from (envoyproxy#49259) and `release.multiarch` does
not build (envoyproxy#49331).

Use them for the images too.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
…9354)

The debug images (`envoy-debug`, `envoy-contrib-debug`) took the `.dwp`s
as llvm-dwp writes them: debug sections uncompressed (over 3GB for
contrib, per arch), each a single blob in the remote cache.

#49294 added the `.dwp`s with their debug sections compressed (zlib,
which the images' gdb 12 reads) and cached in parts
(`//distribution:envoy-dwarf-joined`,
`//distribution:envoy-contrib-dwarf-joined`), but only the release
tarball (`//distribution/binary`) used them. The images are no longer
built from that tarball (#49259), and `release.multiarch` does not build
it (#49331), so nothing published had them.

This points the images' `.dwp`s at the `-joined` targets, as the comment
on the debug layers in this file already describes.

Risk Level: low (the `.dwp` in the published debug images; the same file
the release tarball has had since #49294)
Testing: this PR's Publish (`release.multiarch`), against the postsubmit
of its base (499b706), from the Bazel profiles:

| | base | this PR |
| --- | --- | --- |
| `oci.x64` / `oci.arm64` artifacts | 4.10GB / 4.06GB | 3.29GB / 3.24GB
|
| Writing the `envoy-debug` layer (per arch) | 159s, 101s | 31s, 9s |
| Writing the `envoy-contrib-debug` layer (per arch) | 121s, 96s | 29s,
25s |
| OCI descriptor of the debug layers | 29-54s | 9-12s |
| Compressing the `.dwp`s (new here, remote) | - | 101-118s |
| Joining the parts (new here, local) | - | 7-20s |

The compression runs whenever a `.dwp` changes, so it is not a critical
path win by itself (bazel took 360s here, 443s on the base, where the
`.dwp`s were regenerated and here were not): the gain is the smaller
images and layers, and no multi-GB `.dwp` blob to fetch.
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…voyproxy#49354)

The debug images (`envoy-debug`, `envoy-contrib-debug`) took the `.dwp`s
as llvm-dwp writes them: debug sections uncompressed (over 3GB for
contrib, per arch), each a single blob in the remote cache.

envoyproxy#49294 added the `.dwp`s with their debug sections compressed (zlib,
which the images' gdb 12 reads) and cached in parts
(`//distribution:envoy-dwarf-joined`,
`//distribution:envoy-contrib-dwarf-joined`), but only the release
tarball (`//distribution/binary`) used them. The images are no longer
built from that tarball (envoyproxy#49259), and `release.multiarch` does not build
it (envoyproxy#49331), so nothing published had them.

This points the images' `.dwp`s at the `-joined` targets, as the comment
on the debug layers in this file already describes.

Risk Level: low (the `.dwp` in the published debug images; the same file
the release tarball has had since envoyproxy#49294)
Testing: this PR's Publish (`release.multiarch`), against the postsubmit
of its base (499b706), from the Bazel profiles:

| | base | this PR |
| --- | --- | --- |
| `oci.x64` / `oci.arm64` artifacts | 4.10GB / 4.06GB | 3.29GB / 3.24GB
|
| Writing the `envoy-debug` layer (per arch) | 159s, 101s | 31s, 9s |
| Writing the `envoy-contrib-debug` layer (per arch) | 121s, 96s | 29s,
25s |
| OCI descriptor of the debug layers | 29-54s | 9-12s |
| Compressing the `.dwp`s (new here, remote) | - | 101-118s |
| Joining the parts (new here, local) | - | 7-20s |

The compression runs whenever a `.dwp` changes, so it is not a critical
path win by itself (bazel took 360s here, 443s on the base, where the
`.dwp`s were regenerated and here were not): the gain is the smaller
images and layers, and no multi-GB `.dwp` blob to fetch.
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 5e14399)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…voyproxy#49354)

The debug images (`envoy-debug`, `envoy-contrib-debug`) took the `.dwp`s
as llvm-dwp writes them: debug sections uncompressed (over 3GB for
contrib, per arch), each a single blob in the remote cache.

envoyproxy#49294 added the `.dwp`s with their debug sections compressed (zlib,
which the images' gdb 12 reads) and cached in parts
(`//distribution:envoy-dwarf-joined`,
`//distribution:envoy-contrib-dwarf-joined`), but only the release
tarball (`//distribution/binary`) used them. The images are no longer
built from that tarball (envoyproxy#49259), and `release.multiarch` does not build
it (envoyproxy#49331), so nothing published had them.

This points the images' `.dwp`s at the `-joined` targets, as the comment
on the debug layers in this file already describes.

Risk Level: low (the `.dwp` in the published debug images; the same file
the release tarball has had since envoyproxy#49294)
Testing: this PR's Publish (`release.multiarch`), against the postsubmit
of its base (499b706), from the Bazel profiles:

| | base | this PR |
| --- | --- | --- |
| `oci.x64` / `oci.arm64` artifacts | 4.10GB / 4.06GB | 3.29GB / 3.24GB
|
| Writing the `envoy-debug` layer (per arch) | 159s, 101s | 31s, 9s |
| Writing the `envoy-contrib-debug` layer (per arch) | 121s, 96s | 29s,
25s |
| OCI descriptor of the debug layers | 29-54s | 9-12s |
| Compressing the `.dwp`s (new here, remote) | - | 101-118s |
| Joining the parts (new here, local) | - | 7-20s |

The compression runs whenever a `.dwp` changes, so it is not a critical
path win by itself (bazel took 360s here, 443s on the base, where the
`.dwp`s were regenerated and here were not): the gain is the smaller
images and layers, and no multi-GB `.dwp` blob to fetch.
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 5e14399)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (#49294, #49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Signed-off-by: Ryan Northey <[email protected]>

Backport note (release/v1.40): the images are built from this branch's bases
(the `Dockerfile-envoy` digests: ubuntu 5ec03bb3, distroless 6a2a3346), the new
modules are added to this branch's pins (`rules_cc` 0.2.25, `rules_foreign_cc`
0.16.0, `su-exec` 0.3), and the lockfiles are regenerated.

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
)

The published container images are built with rules_oci
(`//distribution/docker`, #49259) from the base image digests pinned by
`oci.pull` in `MODULE.bazel` (`@ubuntu_base`, `@distroless_base_nossl`).
The `release-images` task (`ci/dependency/release_images.sh`, #49106)
only updated the same digests in `distribution/docker/Dockerfile-envoy`,
so since #49259 its bumps have not reached the published images.

The script now updates the digest in both files. It also fails if an
image's digest in the Dockerfile is not the one pinned in
`MODULE.bazel`, so the two can't drift apart unnoticed. The digests are
not recorded in `MODULE.bazel.lock`, so there is no lockfile change with
a bump.

The Dockerfile is still read for the pinned images and tags, and is
still what `distribution/docker/build.sh` builds from.

Risk Level: low (the dependency workflow's `release-images` task only)
Testing: ran the script against copies of the two files with a stubbed
`docker buildx imagetools inspect`: a bump updates both files, a rerun
reports up to date, and a digest that differs between the files fails.
shellcheck is clean. The workflow task itself has not been run with this
change.
Docs Changes: n/a
Release Notes: n/a

(cherry picked from commit 499b706)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
The debug images took the `.dwp`s as llvm-dwp writes them, with their
debug sections uncompressed (over 3GB for contrib, per arch), and each
as a single blob in the remote cache. The compressed `.dwp`s, cached in
parts (#49294), were only used by the release tarball, which the
images are no longer built from (#49259) and `release.multiarch` does
not build (#49331).

Use them for the images too.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
The release container images and packages are built with Bazel, in the
release build (`release.publish`/`release.multiarch`, envoyproxy#49259, envoyproxy#49331).
Nothing on this branch builds from `Dockerfile-envoy` any more: remove
it, `build.sh`, and the `docker` and `distribution` targets of
`ci/do_ci.sh` (the Docker OCI and Packages jobs, which only run for the
release branches, with their own `do_ci.sh`).

The `release-images` task read the pinned images and their tags from
the Dockerfile. It now reads them from the `oci.pull` entries of
`MODULE.bazel`, where each has its tag in a `# tag:` comment.

Dependabot no longer watches the directory, and the Docker Hub readme
links the `dev` tag to the Bazel package.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…yproxy#49259)

Builds all of the release container images with bazel (rules_oci)
instead of `docker buildx`: `envoy`, `envoy-debug`, `envoy-contrib`,
`envoy-contrib-debug`, `envoy-tools`, `envoy-distroless`,
`envoy-contrib-distroless`, matching the stages of `Dockerfile-envoy`.

- Distroless images: the pinned distroless base, plus the config and
binary layers.
- Ubuntu images: the pinned ubuntu base (`mirror.gcr.io`, same digest as
the Dockerfile), with `ca-certificates`, `openssl` and `tzdata` from a
pinned `snapshot.ubuntu.com` timestamp (rules_distroless). The `RUN`
steps of the `envoy-base` stage become layers:
- `oci_base_edit` (toolshed, envoyproxy/toolshed#5597): adds `envoy` to
the base's passwd/group/shadow/gshadow as `adduser --group --system
envoy` does (uid/gid 101), `/home/envoy`, and the packages to the dpkg
status;
- the package data, the CA bundle (`cacerts`), and `/etc/timezone` /
`/etc/localtime` (`Etc/UTC`);
- `/etc/envoy/{envoy.yaml,VERSION.txt}`, `/docker-entrypoint.sh`,
`su-exec`, the binary (+ `.dwp` for debug), the tools for `-tools`; same
entrypoint/cmd/env/port.
- The binaries use the same opt/strip transition as the release bundle,
so they come from the release build.
- The debug layers are gzipped at level 1: their contents' debug
sections are already compressed (envoyproxy#49294, envoyproxy#49295), which gzip barely
shrinks.
- `release.publish` strips the release binaries locally: the client
downloads them anyway (the release tarball and images are built
locally), while a remote strip waits on a worker fetching the freshly
linked binary (~30s in envoy-ci-staging).

CI targets:
- `release.server`: the release binaries and tools;
`release.server_only` (used by the Publish workflow, and so by release
branches) is the same, unchanged.
- `release.publish` (new): as `release.server`, and the distro packages,
and the images (`//distribution/docker:images`) as OCI tarballs (the
image layout, as `docker buildx -o type=oci` writes it for a single
platform) in the release binary directory.
- `docker` is unchanged (buildx): where `release-publish` is set its job
is skipped, as `release.publish` writes the images to
`build_images/<image>.<arch>.tar` itself. Local loads and multi-platform
builds still use it.

Publish switches to `release.publish` here: `.github/config.yml` sets
`release-publish: true`, so each arch's binary job builds the release
binaries, the images and the packages in one invocation and uploads them
(`release.<arch>`, `oci.<arch>`, `packages.<arch>`), and the separate
Docker OCI and Packages jobs are skipped. Branches without
`release-publish` (the release branches) keep `release.server_only` and
the separate jobs, with buildx.

Differences from the buildx images:
- No `apt-get upgrade`: base paCommit Message: distribution: Build the release container images with
rules_oci
Additional Description:ckages are those of the pinned base until
its digest (and the snapshot) is bumped.
- Only the CA bundle in `/etc/ssl/certs`, not the per-certificate hash
links.

This overrides `envoy_toolshed` with envoyproxy/toolshed#5597 (on the
v0.5.20 release) until it is released; the docs/external jobs fail with
the override ("Missing version info: envoy_toolshed").

---------

Backport note (release/v1.39): this branch builds with WORKSPACE, so:

- rules_oci is 2.2.6, which needs only the aspect_bazel_lib and
  bazel_features that this branch has (later versions need tar.bzl
  0.7 and bazel_lib 3). Its toolchains, and the base images (this
  branch's `Dockerfile-envoy` digests), are set up in
  `bazel/dependency_imports.bzl`.
- rules_distroless and tar.bzl's rules are bzlmod-only: the three
  Ubuntu packages are fetched as `.deb` archives (the same snapshot,
  versions and hashes), and `flatten`, `cacerts` and the OCI tarballs
  are small local rules over the hermetic bsdtar
  (`distribution/docker/layers.bzl`).
- no lockfiles, and no workflow changes (the workflows run from `main`).

(cherry picked from commit aa082aa)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…voyproxy#49354)

The debug images (`envoy-debug`, `envoy-contrib-debug`) took the `.dwp`s
as llvm-dwp writes them: debug sections uncompressed (over 3GB for
contrib, per arch), each a single blob in the remote cache.

envoyproxy#49294 added the `.dwp`s with their debug sections compressed (zlib,
which the images' gdb 12 reads) and cached in parts
(`//distribution:envoy-dwarf-joined`,
`//distribution:envoy-contrib-dwarf-joined`), but only the release
tarball (`//distribution/binary`) used them. The images are no longer
built from that tarball (envoyproxy#49259), and `release.multiarch` does not build
it (envoyproxy#49331), so nothing published had them.

This points the images' `.dwp`s at the `-joined` targets, as the comment
on the debug layers in this file already describes.

Risk Level: low (the `.dwp` in the published debug images; the same file
the release tarball has had since envoyproxy#49294)
Testing: this PR's Publish (`release.multiarch`), against the postsubmit
of its base (499b706), from the Bazel profiles:

| | base | this PR |
| --- | --- | --- |
| `oci.x64` / `oci.arm64` artifacts | 4.10GB / 4.06GB | 3.29GB / 3.24GB
|
| Writing the `envoy-debug` layer (per arch) | 159s, 101s | 31s, 9s |
| Writing the `envoy-contrib-debug` layer (per arch) | 121s, 96s | 29s,
25s |
| OCI descriptor of the debug layers | 29-54s | 9-12s |
| Compressing the `.dwp`s (new here, remote) | - | 101-118s |
| Joining the parts (new here, local) | - | 7-20s |

The compression runs whenever a `.dwp` changes, so it is not a critical
path win by itself (bazel took 360s here, 443s on the base, where the
`.dwp`s were regenerated and here were not): the gain is the smaller
images and layers, and no multi-GB `.dwp` blob to fetch.
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 5e14399)
Signed-off-by: Ryan Northey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants