In order to support any container running Linux with the LogProxyConsumer, we need builds of promtail
that are statically linked.
Static linking is necessary due to the various versions of libc (glibc, muslc), or even the absence of any libc implementation, to be found in containers based on container images other than ubuntu
and the like.
For example, Alpine-based containers ship muslc.
Distroless-based and "from scratch" containers often have no libc at all.
And the promtail
builds from upstream effectively work only on a subset of containers, which is a limitation we cannot afford.
The build-and-release process for statically-linked promtail
binaries is as follows:
- Every 4 hours, the cron-like
check-promtail-releases
GitHub workflow compares the latest upstream release of Loki with specificpromtail-*
tags in this repository. For example, the upstreamv2.4.2
tag pointed at by the upstream release, means that thecheck-promtail-releases
workflow checks for apromtail-v2.4.2
tag in this repository. - If an upstream release is found that has no matching
promtail-*
tag, thebuild-promtail-release.yaml
is triggered, which:- Statically compile
promtail
for different architectures - Try the binary by building containers with different base images and run then with a
docker run
command - Create a shallow tag of the original Loki codebase (without history) and create the
promtail-*
tag from it. - Create a GitHub release with the promtail binaries, pointing at the
promtail-*
tag
- Statically compile