Skip to content

oci: Add oci_base_edit to add users and packages to a base image - #5597

Merged
phlax merged 1 commit into
envoyproxy:mainfrom
phlax:oci-base-edit
Nov 14, 2026
Merged

phlax merged 1 commit into
envoyproxy:mainfrom
phlax:oci-base-edit

Conversation

@phlax

@phlax phlax commented Nov 14, 2026

Copy link
Copy Markdown
Member

rules_oci can not run anything in an image, so the RUN steps of a Dockerfile that add users or install packages on a base image have to be replaced. rules_distroless provides the packages, but its passwd, group and dpkg_status write the whole of those files, which replaces those of the base image.

oci_base_edit (//oci:defs.bzl) reads /etc/{passwd,group,shadow,gshadow} and /var/lib/dpkg/status from the layers of a base image (in order, applying whiteouts), and creates a layer with:

  • users and groups added as adduser adds them: system ids from 100, group: True for a group of the same name with the same id where it is free (adduser --system --group), shadow entries dated as root's so the output only depends on the image, and their home directories;
  • packages (their control archives, eg rules_distroless :control) added to the dpkg status as installed, replacing older entries.

It runs with the jq and bsdtar toolchains of aspect_bazel_lib; nothing is run in the image.

The test builds the layer from a small two layer image layout (the second layer replaces /etc/group) and checks the files, ownership and modes.

For envoy: replaces the adduser --group --system envoy step, and lists the packages installed with rules_distroless, for the ubuntu container images built with rules_oci (envoyproxy/envoy#49260).

@phlax
phlax requested a balanced review from Copilot November 14, 2026 11:51
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Extracted system-file symlinks can redirect chmod operations and account-data writes outside the image root, modifying files on the builder’s filesystem.

5 open issues
What changed in this PR

Adds oci_base_edit to Toolshed’s Bazel OCI tooling, allowing image builds to add accounts and package metadata to an existing base without running commands inside it.

Changes:

  • Introduces a public macro and toolchain-backed action to generate an account and dpkg-status layer.
  • Documents usage with rules_oci and rules_distroless.
  • Adds a two-layer fixture and tests for merged contents, ownership, and permissions.
File Description
bazel/​oci/​tests/​layout/​oci-layout Declares the fixture’s OCI layout version.
bazel/​oci/​tests/​layout/​index.json Points to the fixture manifest.
bazel/​oci/​tests/​layout/​blobs/​sha256/​bfde55ea4bda32c78b0ebfe5995b5013a1b7a0c70076eecc4d93532f86161f27 Defines the fixture’s two layers.
bazel/​oci/​tests/​layout/​blobs/​sha256/​093571765d650b5edaf61e6b0549e453a94de75d925e954a1b818d3e66c321e6 Supplies fixture image configuration.
bazel/​oci/​tests/​BUILD Wires the fixture, generated layer, and test.
bazel/​oci/​tests/​base_edit_test.py Checks generated records and archive metadata.
bazel/​oci/​README.md Explains usage and limitations.
bazel/​oci/​private/​BUILD Exports implementation files.
bazel/​oci/​private/​base_edit.sh Reads base layers and creates the edited layer.
bazel/​oci/​private/​base_edit.bzl Defines the jq/bsdtar-backed Bazel action.
bazel/​oci/​defs.bzl Exposes and documents oci_base_edit.
bazel/​oci/​BUILD Publishes the OCI Starlark library.

Review effort: Balanced

Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026
@phlax
phlax force-pushed the oci-base-edit branch 2 times, most recently from 11c4f8b to 0c23e14 Compare November 14, 2026 12:14
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026
@phlax
phlax requested a balanced review from Copilot November 14, 2026 12:22
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved defects can disclose builder-host files through package control symlinks, restore deleted lower-layer records, hang on non-absolute home paths, and emit invalid GIDs.

4 open issues
5 resolved since last review

Review effort: Balanced

Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
@phlax
phlax requested a balanced review from Copilot November 14, 2026 12:33
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unconditional inherit_errexit breaks execution on macOS Bash 3.2, existing home directories have ownership and permissions overwritten, and non-regular system files can hang processing.

3 open issues
4 resolved since last review

Review effort: Balanced

Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
Comment thread bazel/oci/private/base_edit.sh Resolved
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026
@phlax
phlax requested a balanced review from Copilot November 14, 2026 12:57
phlax added a commit to phlax/envoy that referenced this pull request Nov 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The accumulated path set retains directories deleted by later-layer whiteouts, causing existence checks to skip creation and potentially leave the new user without its requested home.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread bazel/oci/private/base_edit.sh Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The shell implementation’s OCI filesystem replay and security-sensitive account database rewrites warrant human review and Ubuntu-base integration validation beyond the synthetic success-path fixture.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@phlax
phlax merged commit 0dbd94a into envoyproxy:main Nov 14, 2026
55 checks passed
phlax added a commit to envoyproxy/envoy that referenced this pull request Nov 16, 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]>
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/toolshed that referenced this pull request Nov 17, 2026
…nvoyproxy#5597)

rules_oci can not run anything in an image, so the `RUN` steps of a
Dockerfile that add users or install packages on a base image have to be
replaced. rules_distroless `passwd`, `group` and `dpkg_status` write the
whole of those files, which replaces those of the base.

`oci_base_edit` reads the passwd, group, shadow, gshadow and dpkg status
files from the layers of the base image, and creates a layer with users
and groups added as `adduser` adds them, their home directories, and
packages added to the dpkg status.

Backport note (workspace): as on `main`.

(cherry picked from commit 0dbd94a)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/toolshed that referenced this pull request Nov 17, 2026
…nvoyproxy#5597)

rules_oci can not run anything in an image, so the `RUN` steps of a
Dockerfile that add users or install packages on a base image have to be
replaced. rules_distroless `passwd`, `group` and `dpkg_status` write the
whole of those files, which replaces those of the base.

`oci_base_edit` reads the passwd, group, shadow, gshadow and dpkg status
files from the layers of the base image, and creates a layer with users
and groups added as `adduser` adds them, their home directories, and
packages added to the dpkg status.

Backport note (workspace): as on `main`.

(cherry picked from commit 0dbd94a)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/toolshed that referenced this pull request Nov 17, 2026
…nvoyproxy#5597)

rules_oci can not run anything in an image, so the `RUN` steps of a
Dockerfile that add users or install packages on a base image have to be
replaced. rules_distroless `passwd`, `group` and `dpkg_status` write the
whole of those files, which replaces those of the base.

`oci_base_edit` reads the passwd, group, shadow, gshadow and dpkg status
files from the layers of the base image, and creates a layer with users
and groups added as `adduser` adds them, their home directories, and
packages added to the dpkg status.

Backport note (workspace): as on `main`.

(cherry picked from commit 0dbd94a)
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 to phlax/toolshed that referenced this pull request Nov 17, 2026
…nvoyproxy#5597)

rules_oci can not run anything in an image, so the `RUN` steps of a
Dockerfile that add users or install packages on a base image have to be
replaced. rules_distroless `passwd`, `group` and `dpkg_status` write the
whole of those files, which replaces those of the base.

`oci_base_edit` reads the passwd, group, shadow, gshadow and dpkg status
files from the layers of the base image, and creates a layer with users
and groups added as `adduser` adds them, their home directories, and
packages added to the dpkg status.

Backport note (workspace): as on `main`.

(cherry picked from commit 0dbd94a)
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/toolshed that referenced this pull request Nov 17, 2026
…allow the libcxx LLVM version to be set

Port `//oci` (`oci_base_edit`), `//pigz` and `//tarball:compressed_tar.bzl` from `main` at
bazel-v0.5.22, so Envoy's WORKSPACE release branches (`release/v1.39` and earlier) can build their
release container images with rules_oci and gzip the packages with all the cores, as `main` and
`release/v1.40` do.

Backported, with what differs from `main`:

- envoyproxy#5597 `oci_base_edit`: as on `main`.
- envoyproxy#5601 hermetic pigz: the toolchain and the prebuilt repositories only. `setup_pigz()` and
`load_pigz_toolchains()` (`//pigz:repositories.bzl`) replace the module extension, as `//pgp` does
for `sq`, and this repo's `WORKSPACE` calls both. The source build and its packaging stay on
`main`, which publishes the prebuilts. The README describes them as `main` now builds them (against
zlib-ng, envoyproxy#5606, which has nothing else to backport here). `repository_ctx.repo_metadata` is only
called where Bazel has it: Envoy's `release/v1.38` and earlier use Bazel 7.
- envoyproxy#5605 a pigz on the host, by path: `setup_pigz(host_path = ...)`. The prebuilts are not
configurable here, so a prebuilt for the host always takes precedence.
- envoyproxy#5607 `compressed_tar`: as on `main`. zstd uses the consumer's `@zstd` (Envoy has one; this
branch's toolshed does not), so only gzip is tested here, on Linux only.

Also, not a backport: `setup_libcxx_libs(llvm_version = ...)`. The libc++ bundles for
cross-compiling are fetched for toolshed's LLVM (22.1.8), but Envoy's `release/v1.39` and earlier
compile with LLVM 18.1.8, so a cross-compile there (arm64 from x64, as the one-job release build
does) gets LLVM 18's headers with LLVM 22's `__config_site` and fails. The option selects the
bundles of the consumer's LLVM, from the bins release that published them (0.1.59 for 18.1.8).

The prebuilt hashes (`VERSIONS["pigz_sha256"]`) are empty, as in envoyproxy#5601, for the release preparation
to set: the `_release.yml` step that does that comes with envoyproxy#5601 too. This branch has no source
toolchain to fall back to, so `//pigz` is `manual` (there is no pigz without a prebuilt for the
platform), and the tests that run it are `manual` until the hashes are set.

(cherry picked from commit 0dbd94a)
(cherry picked from commit fc8e06e)
(cherry picked from commit 77185d7)
(cherry picked from commit 49947f3)
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
…5597)

rules_oci can not run anything in an image, so the `RUN` steps of a
Dockerfile that add users or install packages on a base image have to be
replaced. rules_distroless `passwd`, `group` and `dpkg_status` write the
whole of those files, which replaces those of the base.

`oci_base_edit` reads the passwd, group, shadow, gshadow and dpkg status
files from the layers of the base image, and creates a layer with users
and groups added as `adduser` adds them, their home directories, and
packages added to the dpkg status.

Backport note (workspace): as on `main`.

(cherry picked from commit 0dbd94a)
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 envoyproxy/envoy 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 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.38): 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.38): 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.37): 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`).
- the distroless base is this branch's (`base-nossl-debian12`), and su-exec is
  `@com_github_ncopa_suexec` here. The dependency metadata is inline in
  `repository_locations.bzl` (no `deps.yaml` on this branch).

(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.38): 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.37): 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`).
- the distroless base is this branch's (`base-nossl-debian12`), and su-exec is
  `@com_github_ncopa_suexec` here. The dependency metadata is inline in
  `repository_locations.bzl` (no `deps.yaml` on this branch).

(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.37): 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`).
- the distroless base is this branch's (`base-nossl-debian12`), and su-exec is
  `@com_github_ncopa_suexec` here. The dependency metadata is inline in
  `repository_locations.bzl` (no `deps.yaml` on this branch).

(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.37): 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`).
- the distroless base is this branch's (`base-nossl-debian12`), and su-exec is
  `@com_github_ncopa_suexec` here. The dependency metadata is inline in
  `repository_locations.bzl` (no `deps.yaml` on this branch).

(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.37): 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`).
- the distroless base is this branch's (`base-nossl-debian12`), and su-exec is
  `@com_github_ncopa_suexec` here. The dependency metadata is inline in
  `repository_locations.bzl` (no `deps.yaml` on this branch).

(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.38): 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants