From 06641209b46b7fe3b91058b24e4654a2b9d99dc9 Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Mon, 2 Dec 2024 13:19:25 -0800 Subject: [PATCH] chore: switch promtails base image from debian to ubuntu (backport release-3.2.x) (#15208) --- Makefile | 1 + clients/cmd/promtail/Dockerfile | 11 ++++++----- clients/cmd/promtail/Dockerfile.arm32 | 4 ++-- clients/cmd/promtail/Dockerfile.cross | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 87e279257dd29..e835ffbbfa96e 100644 --- a/Makefile +++ b/Makefile @@ -895,6 +895,7 @@ trivy: loki-image build-image snyk: loki-image build-image snyk container test $(IMAGE_PREFIX)/loki:$(IMAGE_TAG) --file=cmd/loki/Dockerfile snyk container test $(IMAGE_PREFIX)/loki-build-image:$(IMAGE_TAG) --file=loki-build-image/Dockerfile + snyk container test $(IMAGE_PREFIX)/promtail:$(IMAGE_TAG) --file=clients/cmd/promtail/Dockerfile snyk code test .PHONY: scan-vulnerabilities diff --git a/clients/cmd/promtail/Dockerfile b/clients/cmd/promtail/Dockerfile index 2942f41614f2f..a163f50871814 100644 --- a/clients/cmd/promtail/Dockerfile +++ b/clients/cmd/promtail/Dockerfile @@ -6,12 +6,13 @@ WORKDIR /src/loki 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:12.5-slim +# Promtail requires debian or ubuntu as the base image to support systemd journal reading +FROM public.ecr.aws/ubuntu/ubuntu:noble # tzdata required for the timestamp stage to work -RUN apt-get update && \ - apt-get install -qy tzdata ca-certificates libsystemd-dev && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +# Install dependencies needed at runtime. +RUN apt-get update \ + && apt-get install -qy libsystemd-dev tzdata ca-certificates \ + && 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 ENTRYPOINT ["/usr/bin/promtail"] diff --git a/clients/cmd/promtail/Dockerfile.arm32 b/clients/cmd/promtail/Dockerfile.arm32 index b9f4a26dc8f03..eec94ee8403ff 100644 --- a/clients/cmd/promtail/Dockerfile.arm32 +++ b/clients/cmd/promtail/Dockerfile.arm32 @@ -5,8 +5,8 @@ WORKDIR /src/loki 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:12.5-slim +# Promtail requires debian or ubuntu as the base image to support systemd journal reading +FROM public.ecr.aws/ubuntu/ubuntu:noble # tzdata required for the timestamp stage to work RUN apt-get update && \ apt-get install -qy tzdata ca-certificates wget libsystemd-dev && \ diff --git a/clients/cmd/promtail/Dockerfile.cross b/clients/cmd/promtail/Dockerfile.cross index 5bf89e71fa16d..0500b0ebf54f5 100644 --- a/clients/cmd/promtail/Dockerfile.cross +++ b/clients/cmd/promtail/Dockerfile.cross @@ -13,8 +13,8 @@ COPY . /src/loki 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:12.5-slim +# Promtail requires debian or ubuntu as the base image to support systemd journal reading +FROM public.ecr.aws/ubuntu/ubuntu:noble # tzdata required for the timestamp stage to work RUN apt-get update && \ apt-get install -qy tzdata ca-certificates wget libsystemd-dev && \