Repository navigation
Conversation
Move the runtime image from debian:12 to debian:13-slim, apply pending security updates at build time, install ca-certificates and curl without recommended packages, and clean the apt lists. This removes all critical and fixable OS-level CVEs reported by Trivy on the published v1.30.0 image and reduces the image size from 261 MB to 158 MB. Refs ContentSquare#592
4 of 13 tasks
This branch has not been deployed
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.
Description
Addresses the base-image part of #592.
The runtime image is built from
debian:12with unpinned, never-upgraded packages, so the published image carries a large number of OS-level CVEs. This PR:debian:13-slim(current Debian stable, slim variant)apt-get upgrade -yso the image picks up security fixes released after the base image was builtca-certificatesandcurlwith--no-install-recommends(curl is kept so existingHEALTHCHECK/exec-based probes keep working)Trivy scan of the OS layer, using the same v1.30.0
chproxybinary in both images:contentsquareplatform/chproxy:v1.30.0(debian 12.12)Image size goes from 261 MB to 158 MB. The remaining findings have no fix available in Debian yet, so the next rebuild will pick them up through
apt-get upgrade.Note: findings in the Go binary itself (Go 1.24 stdlib,
golang.org/x/*) are not covered here. Those need a Go toolchain/dependency bump and are better handled in a separate PR, which keeps this one limited to the image.Pull request type
Checklist
Does this introduce a breaking change?
The entrypoint, exposed port, user and available tools (
curl, CA bundle) are unchanged. The chproxy binary is statically linked (CGO_ENABLED=0), so the libc change does not affect it.Further comments
Verified locally:
chproxy -versionruns, andcurlmakes HTTPS requests using the CA bundle.This overlaps with #545 (non-root user), which also edits the Dockerfile. Whichever merges second will need a small rebase, and I'm happy to do it.
I considered
distroless/staticorscratch, which would remove nearly all OS CVEs. I didn't use them here because they would dropcurland the shell, which would break users who rely on them for health checks.