coredns/Dockerfile
Manuel Rüger 517a262e98
Dockerfile: Switch to debian 12 as base (#6968)
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2024-11-12 18:40:01 -05:00

23 lines
742 B
Docker

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 -yyqq upgrade ; \
apt-get -yyqq install ca-certificates libcap2-bin; \
apt-get clean
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/
COPY --from=build /coredns /coredns
USER nonroot:nonroot
WORKDIR /
EXPOSE 53 53/udp
ENTRYPOINT ["/coredns"]