fix(build): remove busybox from dockerfile - #19502
Conversation
| cp /tmp/local-config.yaml /tmp/etc/loki/local-config.yaml && \ | ||
| addgroup --gid 10001 loki && \ | ||
| adduser --uid 10001 --gid 10001 --disabled-password --gecos "" loki && \ | ||
| chown -R loki:loki /tmp/etc/loki /tmp/loki |
There was a problem hiding this comment.
something feels off to me here, previously our final stage was setting the ownership and permissions and it set the permissions on the /loki directory
However now we are setting permissions on an intermediate build stage, and also we are setting it on /tmp/loki not /loki
This feels like it might be incorrect to me
There was a problem hiding this comment.
This is because in our final stage we will use the distroless without sh, so I can't change in there.
The process is set in the intermediate, change the permissions first and then we can copy with from there with the right permissions.
There was a problem hiding this comment.
Good catch on directories, I updated now to not be on /tmp
|
Hello 👋 Slimming down the Docker image seems like a good thing, thanks for that. However, it seems like the Loki binary does not include any way to run a healthcheck. As such, the Docker image for Loki >= 3.6.0 lacks any tools for performing a healthcheck, there is no shell to look for listening ports in the Busybox is a bit overkill for that, but would you be open to adding a |
What this PR does / why we need it:
Busybox included on our distroless dockerfile has a list of CVEs that needs to be addressed.
Going to remove the busybox from our dockerfile and use the distroless:nonroot as base image to follow best security practices.
Which issue(s) this PR fixes:
Fix CVEs:
Running grype scanner we see no vulnerabilities on this image: