Skip to content

feat(images): a runtime base of Wolfi packages built with apko - #411

Merged
ndreno merged 2 commits into
mainfrom
feat/runtime-base
Nov 18, 2026
Merged

ndreno merged 2 commits into
mainfrom
feat/runtime-base

Conversation

@ndreno

@ndreno ndreno commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #397.

barbacane and barbacane-control move to a runtime base this repository defines and builds: Wolfi packages installed by apko from a committed lock. It replaces Chainguard's glibc-dynamic (free tier: latest only) under the data plane and Debian 12 slim under the control plane. The prototype and its measurements are in #404.

What changes

  • docker/runtime.apko.yaml: wolfi-baselayout, ca-certificates-bundle, glibc-2.44, ld-linux-2.44 and libgcc from packages.wolfi.dev, and nonroot (65532) with its home. No shell, no package manager. docker/runtime.apko.lock.json pins every package by version and checksum.
  • Dockerfile, Dockerfile.control: a runtime stage runs apko v1.4.15 on the build platform and installs the locked packages for the target architecture; the final stage is scratch with those files and the binary. The release, CI's image job and make docker-build build them unchanged. The binaries are built with cargo auditable, so scanners read their crates (in proto(images): a runtime base built with apko from Wolfi, checked in CI (#397) #404 Grype found two GitHub-only advisories that cargo deny cannot see, fixed in chore(deps): tar 0.4.46 and rand 0.8.6 #410).
  • barbacane-control health: GET <url>/health, exit 0 on 200 within 5 s, 1 with the reason otherwise. The control-plane image's HEALTHCHECK runs it, since the image has no shell.
  • Control-plane image: runs as nonroot (65532, home /home/nonroot) in place of the barbacane system user. Breaking for a health check that runs a shell command in the container; CHANGELOG and the migration guide say what to use.
  • Runtime base workflow: every night, scans the base from the committed lock and the latest release's three images (high or critical with a fix fails), and locks again; a newer lock goes to deps/runtime-base. Actions may not open pull requests in this repository, so a person opens it, which also starts CI. On a pull request touching the base, it locks and scans without pushing.
  • CI's image job: the two images hold no shell or package manager, /home/nonroot belongs to 65532, /tmp is 1777, and the apk database scanners read is there.
  • Docs: CLI reference (barbacane-control health), control-plane guide, migration guide, FIPS guide, contributor guide (how the base is locked and refreshed); CHANGELOG.

The base is built inside each Dockerfile rather than published and pinned by digest: there is no Dependabot here and Actions cannot open pull requests, so a published base would need a hand-made digest bump after every publish. The lock gives the same pinning, and each lock change is built and scanned in its own pull request. Publishing the base for other repositories is one more build target if one needs it.

Measured in #404 (gateway, same commit, both run as containers)

today (glibc-dynamic) this base
mock route, req/s 2,891 2,870 (0.99)
proxied route, req/s 1,365 1,361 (1.00)
p99, proxied 108.0 ms 108.0 ms
peak RSS 78.6 MiB 79.5 MiB
image, compressed 19.3 MB 18.0 MB
default Grype scan, OS matches 0 0

Not in this pull request

  • A health subcommand for the data plane: its image has had no shell since 1.0.0-rc.1, and orchestrators probe it over HTTP.
  • barbacane-standalone keeps Debian and its shell.
  • The playground's compose file checks the control plane with bash; it needs ["CMD", "/usr/local/bin/barbacane-control", "health"] when it moves to a release with this change.

Checks

  • barbacane-control health against a local server: 200 exits 0, 404 and a closed port exit 1 with the reason.
  • CI on 015c91f: both images build on the base and pass the files check; Grype finds 0 matches across 402 packages (barbacane) and 298 (barbacane-control); health_succeeds_only_when_the_control_plane_answers_200 passes; the Runtime base workflow locks and scans the base.
  • The playground follow-up is Check the control plane with barbacane-control health playground#9 (draft until a release includes this). Its CI on 1.0.0-rc.1 shows the control plane unhealthy (unrecognized subcommand 'health') and the gateway healthy.

The data plane image ran on cgr.dev/chainguard/glibc-dynamic, whose
free tier publishes `latest` only, and the control plane on Debian 12
slim. Both now run on a base the repository defines:

- docker/runtime.apko.yaml lists wolfi-baselayout,
  ca-certificates-bundle, glibc-2.44, ld-linux-2.44 and libgcc from
  packages.wolfi.dev, and the nonroot user (65532) with its home;
  docker/runtime.apko.lock.json pins every package by version and
  checksum.
- Both Dockerfiles build the base from the lock in a stage of their
  own (apko v1.4.15, on the build platform, for the target
  architecture) and copy its files under the binary on scratch. The
  release, CI's image job and `make docker-build` build them as before.
- The binaries are built with `cargo auditable`, so scanners read their
  crates.
- `barbacane-control health` calls /health and exits 0 on 200: the
  control-plane image has no shell, and its HEALTHCHECK runs it.
- The Runtime base workflow scans the base and the latest release's
  images every night, and pushes a newer lock to deps/runtime-base;
  Actions may not open pull requests here, so a person opens it.
- CI's image job checks the two images hold no shell or package
  manager, the home belongs to 65532, /tmp is 1777 and the apk database
  is there.

The prototype in #404 measured the gateway on this base against
today's image: same throughput and latency on a mock and a proxied
route (0.99 and 1.00), same peak memory (1.01), 18.0 MB against
19.3 MB, and a default Grype scan finds no OS matches on either.
Debian's glibc on scratch had cost up to 10% on proxied routes and
listed 31 to 33 CVEs; static musl ran 4x slower (#409).

The lock comes from the Runtime base workflow's first run on this
branch.

Refs #397.
@ndreno ndreno added this to the v1.0.0 milestone Nov 18, 2026
glibc-2.44 and its loader and POSIX locale at 2.44-r23, libgcc
16.2.0-r5, ca-certificates-bundle 20261020-r0 and wolfi-baselayout
20230201-r31, for amd64 and arm64, as the Runtime base workflow
locked them (run 44397561698).
@ndreno
ndreno marked this pull request as ready for review November 18, 2026 21:25
@ndreno
ndreno merged commit 859b7a2 into main Nov 18, 2026
31 checks passed
ndreno added a commit that referenced this pull request Nov 19, 2026
The release builds every image for linux/amd64 and linux/arm64, each on
a native runner, but CI built amd64 only, so a tag was the first time
an arm64 image was built. Since #411 the Dockerfiles also run apko for
the target architecture, which no arm64 build has exercised yet.

The image job now runs each image on both architectures, on the
runners the release uses: build, run the binary, check the files on
the runtime base, and the release's Grype scan.
ndreno added a commit to barbacane-dev/playground that referenced this pull request Nov 19, 2026
* Check the control plane with `barbacane-control health`

From barbacane-dev/barbacane#411 on, the barbacane-control image has no
shell, so the compose health check `bash -c 'echo > /dev/tcp/...'`
cannot run and the container stays unhealthy. The image ships
`barbacane-control health`, which calls GET /health; the check runs it.

CI did not notice: the smoke test reaches the control plane over HTTP
and nothing waits for its health check. A new step after the smoke
test requires every running service with a health check to report
healthy.

1.0.0-rc.1 has no `health` subcommand, so this goes in with the bump to
the first release that has it.

Signed-off-by: Nicolas Dreno <nicolas.dreno@barbacane.dev>

* Pin the playground to Barbacane 1.0.0-rc.2

The control-plane health check runs `barbacane-control health`, which
first ships in 1.0.0-rc.2, so that release is also the new minimum.

---------

Signed-off-by: Nicolas Dreno <nicolas.dreno@barbacane.dev>
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.

Align the container images on Wolfi

1 participant