From 6538785deff048752fe0fd0fb54267ca2654aea8 Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Sun, 9 Nov 2025 07:32:23 +1300 Subject: [PATCH] chore: Update `Dockerfile` (#7661) --- Dockerfile | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5202e8b7b..140a30340 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,14 @@ ARG DEBIAN_IMAGE=debian:stable-slim ARG BASE=gcr.io/distroless/static-debian12:nonroot -FROM --platform=$BUILDPLATFORM ${DEBIAN_IMAGE} AS build -SHELL [ "/bin/sh", "-ec" ] -RUN export DEBCONF_NONINTERACTIVE_SEEN=true \ - DEBIAN_FRONTEND=noninteractive \ - DEBIAN_PRIORITY=critical \ - TERM=linux ; \ - apt-get -qq update ; \ - apt-get -qq upgrade ; \ - apt-get -qq --no-install-recommends install ca-certificates libcap2-bin; \ - apt-get clean +FROM --platform=$BUILDPLATFORM ${DEBIAN_IMAGE} AS build +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -qq update \ + && apt-get -qq --no-install-recommends install libcap2-bin COPY coredns /coredns RUN setcap cap_net_bind_service=+ep /coredns -FROM --platform=$TARGETPLATFORM ${BASE} -COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +FROM ${BASE} COPY --from=build /coredns /coredns USER nonroot:nonroot # Reset the working directory inherited from the base image back to the expected default: