From 23e0e5d18f83beb6ac6707bd250257e207fc2864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Fri, 20 Aug 2021 16:01:06 +0800 Subject: [PATCH] Change the base image to distroless (#4055) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the base image to distroless Signed-off-by: Wenkai Yin(尹文开) --- Dockerfile | 6 ++---- changelogs/unreleased/4055-ywk253100 | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/4055-ywk253100 diff --git a/Dockerfile b/Dockerfile index 60f9617a1..bdead4f8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,13 +50,11 @@ RUN mkdir -p /output/usr/bin && \ go build -o /output/${BIN} \ -ldflags "${LDFLAGS}" ${PKG}/cmd/${BIN} -FROM ubuntu:focal +FROM gcr.io/distroless/base-debian10:nonroot LABEL maintainer="Nolan Brubaker " -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ca-certificates tzdata && rm -rf /var/lib/apt/lists/* - COPY --from=builder /output / -USER nobody:nogroup +USER nonroot:nonroot diff --git a/changelogs/unreleased/4055-ywk253100 b/changelogs/unreleased/4055-ywk253100 new file mode 100644 index 000000000..4dd9a9c85 --- /dev/null +++ b/changelogs/unreleased/4055-ywk253100 @@ -0,0 +1 @@ +Change the base image to distroless \ No newline at end of file