From 0b84ef8868b74913d8beedc2eac91a3cbcedd99a Mon Sep 17 00:00:00 2001 From: Ed Welch Date: Tue, 24 Nov 2020 10:55:43 -0500 Subject: [PATCH] Promtail: Update debian image and use a newer libsystemd (#2957) * use a newer libsystemd which understands compression needed in some of the newer OS distros * add comments --- cmd/promtail/Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/promtail/Dockerfile b/cmd/promtail/Dockerfile index 3a704e5316da..aeca916a5519 100644 --- a/cmd/promtail/Dockerfile +++ b/cmd/promtail/Dockerfile @@ -1,18 +1,23 @@ -FROM golang:1.15.3 as build +FROM golang:1.15.3-buster as build # TOUCH_PROTOS signifies if we should touch the compiled proto files and thus not regenerate them. # This is helpful when file system timestamps can't be trusted with make ARG TOUCH_PROTOS COPY . /src/loki WORKDIR /src/loki -RUN apt-get update && apt-get install -qy libsystemd-dev +# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression +RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list +RUN apt-get update && apt-get install -t buster-backports -qy libsystemd-dev RUN make clean && (if [ "${TOUCH_PROTOS}" ]; then make touch-protos; fi) && make BUILD_IN_CONTAINER=false promtail # Promtail requires debian as the base image to support systemd journal reading -FROM debian:stretch-slim +FROM debian:buster-slim # tzdata required for the timestamp stage to work +# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression +RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list RUN apt-get update && \ apt-get install -qy \ - tzdata ca-certificates libsystemd-dev && \ + tzdata ca-certificates +RUN apt-get install -t buster-backports -qy libsystemd-dev && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY --from=build /src/loki/cmd/promtail/promtail /usr/bin/promtail COPY cmd/promtail/promtail-docker-config.yaml /etc/promtail/config.yml