Repository navigation
8000
div>
Install current Debian security updates in release images - #282
Merged
Merged
Conversation
Release builds reuse the apt layer cached by earlier builds, so a release only picks up Debian package updates when python:3.12-slim itself changes. 0.11.0's build log shows that layer CACHED on amd64 and arm64, and the image carries nginx 1.26.3-3+deb13u10. python:3.12-slim still resolves to the same digest, so a release cut today would ship that layer again and miss 1.26.3-3+deb13u11 (DSA-6642-1). The runtime stage now declares OS_PACKAGES_REFRESH ahead of the apt layer and runs apt-get upgrade in it, which also covers packages that come with the base image. The release workflow passes a value unique to each run, so every release reruns the layer. Both of its builds pass the same value, so the push build still reuses the smoke build's amd64 layers. Other builds keep the default and the cached layer. Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release builds reuse the apt layer cached by earlier builds, so a release only gets Debian package updates when
python:3.12-slimitself changes. 0.11.0's release log shows that layerCACHEDon amd64 and arm64, and the published image carries nginx1.26.3-3+deb13u10.python:3.12-slimstill resolves to the digest 0.11.0 used, so a release cut today would ship the same layer and miss1.26.3-3+deb13u11(DSA-6642-1: CVE-2026-123633, CVE-2026-123007, CVE-2026-123634).# docker-release.yml, both build steps build-args: | APP_VERSION=${{ steps.meta.outputs.version }} + OS_PACKAGES_REFRESH=${{ github.run_id }}-${{ github.run_attempt }}A new value reruns the apt layer, so every release installs current packages. Both release builds pass the same value, so the push build still reuses the smoke build's amd64 layers.
apt-get upgradecovers packages that come with the base image, which can trail Debian's security updates as well. Dev and local builds keep the default and the cache.docs/gotchas.mdnotes that dev images can lag.Evidence
Local arm64 builds of this branch,
docker build --build-arg OS_PACKAGES_REFRESH=<value> .:verify-averify-aCACHEDverify-bghcr.io/tracefinity/tracefinity:0.11.0hasnginx 1.26.3-3+deb13u10. Release run log:#60 [linux/amd64 stage-1 2/24] RUN apt-get update ...then#60 CACHED.After: the image from build 1 has
nginx 1.26.3-3+deb13u11. Afterapt-get update,apt list --upgradablelists 0 packages.sh /app/tests/test_entrypoint.shreports 16 passed and 0 failed, andGET /through the image's nginx on port 3000 returns 200.The workflow change only runs on a published release, so it is checked when the next release builds: its log should show the apt layer running on both platforms.
Merge Danger
Door: two-way. Reverting restores cached release builds.
Blast Radius: release builds. Each release rebuilds the runtime stage from the apt layer down on both platforms, so it takes longer than the current two minutes or so. Release images move to current Debian trixie package versions.