Skip to content

[FIX] apk upgrade at build, so Alpine fixes land before the base image is rebuilt - #196

Merged
david-banon-tecnativa merged 1 commit into
Tecnativa:masterfrom
sammcj:upstream-base-update
Nov 17, 2026
Merged

david-banon-tecnativa merged 1 commit into
Tecnativa:masterfrom
sammcj:upstream-base-update

Conversation

@sammcj

@sammcj sammcj commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Rebased on top of #185, which covers the rolling base tag, dependency updates and CI changes this PR originally carried. What remains is the part #185 does not cover. Follow-up to #190.

  • apk upgrade --no-cache in the Dockerfile. The haproxy base image lags Alpine, so a rolling tag alone leaves a window: the :latest built on 16 Nov has zlib 1.3.2-r1 (ALPINE-CVE-2026-4738, 9.4 per OSV-Scanner v2.7.0) while Alpine has 1.4-r0
  • no-cache = true on the bake target. With the GHA layer cache the upgrade layer would be reused for as long as the base image digest is unchanged, which is exactly the window this is meant to close. The image builds in seconds, so the cache buys little
  • Tests also cover the /events stream and container listing
Image OSV findings
ghcr.io/tecnativa/docker-socket-proxy:latest (16 Nov) 1 critical (zlib)
This branch, lts and 3.4 0

pytest --prebuild passes 5 of 5 locally. The final user, and the owner of /var/lib/haproxy/server-state, are unchanged.

If you would rather keep the layer cache, a cache-busting build arg scoped to the upgrade layer would also work; happy to switch.

@sammcj sammcj changed the title [IMP] Rolling HAProxy 3.4 base and apk upgrade at build, to clear base image CVEs [FIX] Rolling HAProxy 3.4 base and apk upgrade at build, to clear base image CVEs Nov 14, 2026
@david-banon-tecnativa

Copy link
Copy Markdown
Collaborator

Hi, thanks for your work on this.
As #185 has been merged, :latest is now build from the lts tag and aditionally the 3.4 tag built from 3.4 also exists if you don't want to change from haproxy 3.4 when lts is upgraded to 3.6 or whatever next lts is.

Are any other changes you proposed here not covered by that?

… is rebuilt

- The haproxy base image lags Alpine: lts-alpine currently ships zlib 1.3.2-r1
  (ALPINE-CVE-2026-4738) while Alpine has 1.4-r0
- Bake builds without layer cache, otherwise the upgrade layer is reused for
  as long as the base image digest is unchanged
- Tests cover the events stream and container listing
@sammcj
sammcj force-pushed the upstream-base-update branch from 11d3e59 to 869b4d8 Compare November 16, 2026 21:31
@sammcj sammcj changed the title [FIX] Rolling HAProxy 3.4 base and apk upgrade at build, to clear base image CVEs [FIX] apk upgrade at build, so Alpine fixes land before the base image is rebuilt Nov 16, 2026
@sammcj

sammcj commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@david-banon-tecnativa thanks, #185 covers the base tag, the dependency bumps and the CI changes. Two things here were not covered, and I have rebased the PR down to just those on top of current master:

  1. apk upgrade --no-cache at build. The :latest built on 16 Nov still has zlib 1.3.2-r1 (ALPINE-CVE-2026-4738, 9.4 per OSV-Scanner). Alpine has 1.4-r0, but haproxy:lts-alpine has not been rebuilt with it, so a rolling base tag alone leaves that window open. I also set no-cache = true on the bake target, since a cached layer would skip the upgrade while the base digest is unchanged.
  2. Test checks for the /events stream and container listing.

With the change, both the lts and 3.4 builds scan at 0 findings.

@david-banon-tecnativa
david-banon-tecnativa merged commit 1d29662 into Tecnativa:master Nov 17, 2026
7 checks passed
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