From ad08d010fbeb2df02e38433064916d8ee8bc37b3 Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Fri, 11 Aug 2023 14:28:55 -0700 Subject: [PATCH] chore(releasing): Run hadolint on distributed Dockerfiles (#18224) * chore(releasing): Run hadolint on distributed Dockerfiles Signed-off-by: Jesse Szwedko * spelling Signed-off-by: Jesse Szwedko --------- Signed-off-by: Jesse Szwedko --- .github/actions/spelling/expect.txt | 3 +-- distribution/docker/alpine/Dockerfile | 2 ++ distribution/docker/debian/Dockerfile | 2 ++ distribution/docker/distroless-libc/Dockerfile | 4 +++- distribution/docker/distroless-static/Dockerfile | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 55cd47a320233..3d472b5be00bb 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -37,7 +37,6 @@ asdf asdfasdf assertverify Asterix -asynk atag atx aty @@ -460,6 +459,7 @@ gty Guangzhou guenter gzip'ed +hadolint halfsies hannes Hashbang @@ -569,7 +569,6 @@ kernelmode keybase keyclock keyid -keypair keyxxxxx khvzak kib diff --git a/distribution/docker/alpine/Dockerfile b/distribution/docker/alpine/Dockerfile index c3479f1001191..c749e9fc0540a 100644 --- a/distribution/docker/alpine/Dockerfile +++ b/distribution/docker/alpine/Dockerfile @@ -8,6 +8,8 @@ RUN tar -xvf vector-0*-"$(cat /etc/apk/arch)"-unknown-linux-musl*.tar.gz --strip RUN mkdir -p /var/lib/vector FROM docker.io/alpine:3.18 +# we want the latest versions of these +# hadolint ignore=DL3018 RUN apk --no-cache add ca-certificates tzdata COPY --from=builder /vector/bin/* /usr/local/bin/ diff --git a/distribution/docker/debian/Dockerfile b/distribution/docker/debian/Dockerfile index 4e645f9924cdd..c678dfd3080ee 100644 --- a/distribution/docker/debian/Dockerfile +++ b/distribution/docker/debian/Dockerfile @@ -9,6 +9,8 @@ RUN mkdir -p /var/lib/vector FROM docker.io/debian:bookworm-slim +# we want the latest versions of these +# hadolint ignore=DL3008 RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates tzdata systemd && rm -rf /var/lib/apt/lists/* COPY --from=builder /usr/bin/vector /usr/bin/vector diff --git a/distribution/docker/distroless-libc/Dockerfile b/distribution/docker/distroless-libc/Dockerfile index 303311d14165c..773aeadcbdc93 100644 --- a/distribution/docker/distroless-libc/Dockerfile +++ b/distribution/docker/distroless-libc/Dockerfile @@ -7,7 +7,9 @@ RUN dpkg -i vector_*_"$(dpkg --print-architecture)".deb RUN mkdir -p /var/lib/vector -FROM gcr.io/distroless/cc-debian11 +# distroless doesn't use static tags +# hadolint ignore=DL3007 +FROM gcr.io/distroless/cc-debian11:latest COPY --from=builder /usr/bin/vector /usr/bin/vector COPY --from=builder /usr/share/doc/vector /usr/share/doc/vector diff --git a/distribution/docker/distroless-static/Dockerfile b/distribution/docker/distroless-static/Dockerfile index 874c165d64457..280c7d6be25d0 100644 --- a/distribution/docker/distroless-static/Dockerfile +++ b/distribution/docker/distroless-static/Dockerfile @@ -7,7 +7,9 @@ RUN tar -xvf vector-0*-"$(cat /etc/apk/arch)"-unknown-linux-musl*.tar.gz --strip RUN mkdir -p /var/lib/vector -FROM gcr.io/distroless/static +# distroless doesn't use static tags +# hadolint ignore=DL3007 +FROM gcr.io/distroless/static:latest COPY --from=builder /vector/bin/* /usr/local/bin/ COPY --from=builder /vector/config/vector.toml /etc/vector/vector.toml