From 4549c1425a9c8ad94b50492203facc5e1ae5c14e 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 15:25:41 +0800 Subject: [PATCH] Change the base image to distroless MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wenkai Yin(尹文开) --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf9ae27..b006ad7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,10 @@ COPY . /go/src/velero-plugin-for-gcp WORKDIR /go/src/velero-plugin-for-gcp RUN CGO_ENABLED=0 GOOS=linux go build -v -o /go/bin/velero-plugin-for-gcp ./velero-plugin-for-gcp +FROM busybox:1.33.1 AS busybox -FROM ubuntu:bionic -RUN mkdir /plugins +FROM gcr.io/distroless/base-debian10:nonroot COPY --from=build /go/bin/velero-plugin-for-gcp /plugins/ -USER nobody:nogroup -ENTRYPOINT ["/bin/bash", "-c", "cp /plugins/* /target/."] +COPY --from=busybox /bin/cp /bin/cp +USER nonroot:nonroot +ENTRYPOINT ["cp", "/plugins/velero-plugin-for-gcp", "/target/."]