-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide both alpine and debian promtail images #838
Comments
For promtail to be able to read from the systemd journal, libsystemd.so must be present at runtime. There is currently no package for alpine that provides this file and such, debian should be used instead. A future solution for providing an alpine-based build should be considered in the future and will be tracked in grafana#838. This commit also updates the Dockerfile to default to using the latest loki-build-image. If a specific version is required, it should be provided as a build arg to docker build.
This commit modifies the Makefile to build promtail with CGO_ENABLED if both GOHOSTOS and GOOS are set to linux. To facilitate the Docker container utilizing the journal support, the container for promtail had to be modified to be based on top of debian. The sd-journal library depends on libsystemd.so being present at runtime. As alpine currently does not have a package for systemd, the easiest approach is to change the base image to debian:stretch-slim. A future solution for providing an alpine-based build will be considered in the future and discussion for the approach will be tracked in #838. This commit also updates the Dockerfile to default to using the latest loki-build-image. If a specific version is required, it should be provided as a build arg to docker build.
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Is there any plan to proceed with this topic? The current promtail image is showing lots of vulnerabilities in outdated open source components if uploaded to AWS ECR or Google container registry. |
We haven't prioritized it, but we do understand this is important to people. I think at this stage we're still hoping for a better solution; providing an alpine image that doesn't support systemd journal reading feels a little bad. /cc @slim-bean |
Checking some other projects incl. Grafana, it seems to be a very common pattern to provide alpine based images and also images based on a more comprehensive operating system. |
Here's what I ended up with:
The difference in size is ~100MB
|
@amenzhinsky |
Try this:
More about Docker alpine executable binary not found |
@rfratto I see that loki-promtail is in alpine edge here: https://pkgs.alpinelinux.org/packages?name=loki-promtail&branch=edge&repo=testing&arch=&maintainer=. Will this continue to be maintained and move to community and main? It currently works with my application but I don't want to start using it if it has no future. It appears the author is Michael Pirogov (@uu) but he isn't an official member of the grafana org. Do you know him? Otherwise is there instructions for using a promtail agent within an Alpine image? |
Tried to bump up 2.7.1, but there's some fails in tests. |
I'm no longer involved with the Loki project and won't be able to weigh in on this, sorry folks. cc @slim-bean |
I think we can close this, the Agent provides a debian package iirc |
Trivy reports plenty of vulnerabilities in the base image. Would be great to switch to minimalistic alpine image, similar like loki does.
See also: |
@taraspos Thanks for the heads up. I agree, we should do different things there:
|
Hey @chaudum, thanks a lot for the debian image update. However I see this change wasn't released still. Would it be possible prepare 2.9.9 release with this new base image? |
For the systemd journal support to work in the published Docker images (
grafana/loki
), we currently require promtail to be based on top of one of the Debian images due to the runtime depedency onlibsystemd.so
.Since most users will likely not need this functionality and may desire an alpine-based image, one solution is to provide an alpine-flavor build of promtail with each release. (i.e.,
grafana/loki:x.y.z-alpine
).Other approaches to this are welcome in the comments!
The text was updated successfully, but these errors were encountered: