build: use scratch runtime images - #8815
SidheshwarSarangal wants to merge 1 commit into
Conversation
|
We should keep in mind that some end users prefer logging in their own timezone. Only the operator binary embeds timezone data, while the admission and reloader binaries do not include Distroless provides Prometheus may have chosen distroless for similar reasons, and Grafana uses distroless as well. Since much of the surrounding ecosystem already uses distroless as a base image, I personally recommend following the same approach. |
1caf896 to
93fba23
Compare
|
Thanks for the guidance. I updated all three runtime stages to gcr.io/distroless/static-debian12:nonroot, which preserves a non-root runtime while providing CA certificates and timezone data. I rebuilt each image and verified each binary with --help. |
93fba23 to
393006c
Compare
|
May use |
simonpasquier
left a comment
There was a problem hiding this comment.
The plan discussed in #8748 was to have distroless variants as moving away from busybox images is a major (potentially breaking) change for users.
Keep BusyBox images as the default while adding separately tagged distroless variants for the operator, config reloader, and admission webhook. Build, publish, sign, and validate the variants in CI. Relates to prometheus-operator#8748 Signed-off-by: Sidheshwar Sarangal <sidheshwar.sarangal@gmail.com>
393006c to
a28499a
Compare
Description
Replace the BusyBox runtime stages for the operator, Prometheus config reloader, and admission webhook with
gcr.io/distroless/static-debian12:nonroot.The Go binaries are built with
CGO_ENABLED=0. The distroless base keeps the containers non-root while providing CA certificates and timezone data.Relates to #8748
Testing
--helpgit diff --checkAI assistance
AI assistance was used to inspect the build configuration and draft this focused change. I reviewed the diff and can explain it.