Skip to content

Commit

Permalink
chore(promtail): Update Promtail base image to Debian 12.5 (grafana#1…
Browse files Browse the repository at this point in the history
…2672)

Debian 11 (Bullseye) has been superseded by Debian 12 (Bookworm).

```console
$ trivy image -q grafana/promtail:chaudum-promtail-base-image-6336f56

grafana/promtail:chaudum-promtail-base-image-6336f56 (debian 12.5)

Total: 100 (UNKNOWN: 0, LOW: 67, MEDIUM: 23, HIGH: 9, CRITICAL: 1)
```

The 1 CRITICAL is a "will_not_fix".

---

Signed-off-by: Christian Haudum <[email protected]>
  • Loading branch information
chaudum authored Apr 18, 2024
1 parent 6dce988 commit 019f364
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
14 changes: 4 additions & 10 deletions clients/cmd/promtail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
FROM golang:1.21.9-bullseye as build
FROM golang:1.21.9-bookworm as build

COPY . /src/loki
WORKDIR /src/loki
# 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 bullseye-backports main" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -t bullseye-backports -qy libsystemd-dev
RUN apt-get update && apt-get install -qy libsystemd-dev
RUN make clean && make BUILD_IN_CONTAINER=false PROMTAIL_JOURNAL_ENABLED=true promtail

# Promtail requires debian as the base image to support systemd journal reading
FROM debian:bullseye-slim
FROM debian:12.5-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 bullseye-backports main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -qy \
tzdata ca-certificates
RUN apt-get install -t bullseye-backports -qy libsystemd-dev && \
apt-get install -qy tzdata ca-certificates libsystemd-dev && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=build /src/loki/clients/cmd/promtail/promtail /usr/bin/promtail
COPY clients/cmd/promtail/promtail-docker-config.yaml /etc/promtail/config.yml
Expand Down
14 changes: 4 additions & 10 deletions clients/cmd/promtail/Dockerfile.arm32
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
FROM golang:1.21.9-bullseye as build
FROM golang:1.21.9-bookworm as build

COPY . /src/loki
WORKDIR /src/loki
# 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 bullseye-backports main" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -t bullseye-backports -qy libsystemd-dev
RUN apt-get update && apt-get install -qy libsystemd-dev
RUN make clean && make BUILD_IN_CONTAINER=false PROMTAIL_JOURNAL_ENABLED=true promtail

# Promtail requires debian as the base image to support systemd journal reading
FROM debian:bullseye-slim
FROM debian:12.5-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 bullseye-backports main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -qy \
tzdata ca-certificates
RUN apt-get install -t bullseye-backports -qy libsystemd-dev && \
apt-get install -qy tzdata ca-certificates libsystemd-dev && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=build /src/loki/clients/cmd/promtail/promtail /usr/bin/promtail
COPY clients/cmd/promtail/promtail-local-config.yaml /etc/promtail/local-config.yaml
Expand Down
5 changes: 2 additions & 3 deletions clients/cmd/promtail/Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ WORKDIR /src/loki
RUN make clean && GOARCH=$(cat /goarch) GOARM=$(cat /goarm) make BUILD_IN_CONTAINER=false PROMTAIL_JOURNAL_ENABLED=true promtail

# Promtail requires debian as the base image to support systemd journal reading
FROM debian:stretch-slim
FROM debian:12.5-slim
# tzdata required for the timestamp stage to work
RUN apt-get update && \
apt-get install -qy \
tzdata ca-certificates libsystemd-dev && \
apt-get install -qy tzdata ca-certificates libsystemd-dev && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=build /src/loki/clients/cmd/promtail/promtail /usr/bin/promtail
COPY clients/cmd/promtail/promtail-local-config.yaml /etc/promtail/local-config.yaml
Expand Down

0 comments on commit 019f364

Please sign in to comment.