8000 Install current Debian security updates in release images by jasonmadigan · Pull Request #282 · tracefinity/tracefinity · GitHub
[go: up one dir, main page]

Skip to content

Install current Debian security updates in release images - #282

Merged
jasonmadigan merged 1 commit into
mainfrom
ci/refresh-os-packages-on-release
Nov 20, 2026
Merged

jasonmadigan merged 1 commit into
mainfrom
ci/refresh-os-packages-on-release

Conversation

@jasonmadigan
Copy link
Copy Markdown
Collaborator

Summary

Release builds reuse the apt layer cached by earlier builds, so a release only gets Debian package updates when python:3.12-slim itself changes. 0.11.0's release log shows that layer CACHED on amd64 and arm64, and the published image carries nginx 1.26.3-3+deb13u10. python:3.12-slim still resolves to the digest 0.11.0 used, so a release cut today would ship the same layer and miss 1.26.3-3+deb13u11 (DSA-6642-1: CVE-2026-123633, CVE-2026-123007, CVE-2026-123634).

 FROM python:3.12-slim

+ARG OS_PACKAGES_REFRESH=cached
 RUN apt-get update && \
+    apt-get upgrade -y && \
     apt-get install -y \
 # 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 upgrade covers 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.md notes that dev images can lag.

Evidence

Local arm64 builds of this branch, docker build --build-arg OS_PACKAGES_REFRESH=<value> .:

build value apt layer time
1 verify-a ran 70s
2 verify-a CACHED 1s
3 verify-b ran 68s
  • Before: ghcr.io/tracefinity/tracefinity:0.11.0 has nginx 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. After apt-get update, apt list --upgradable lists 0 packages. sh /app/tests/test_entrypoint.sh reports 16 passed and 0 failed, and GET / 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.

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>
@jasonmadigan
jasonmadigan merged commit 91156b7 into main Nov 20, 2026
6 checks passed
@jasonmadigan
jasonmadigan deleted the ci/refresh-os-packages-on-release branch November 20, 2026 16:48
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.

1 participant

0