From ca914e2ab87e1d3eb114cf19d4dc7c2fc92b14e6 Mon Sep 17 00:00:00 2001 From: Camal Cakar Date: Wed, 13 May 2020 07:25:36 +0200 Subject: [PATCH] Container Image Enhancements Use Multi=Stage Builds to get certificats Use scratch as base image to reduce size and attack surface --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5722d7..6b72a80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -FROM alpine +FROM alpine as build -RUN apk add --no-cache ca-certificates +RUN apk add --update --no-cache ca-certificates +FROM scratch +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY github-weather /bin/github-weather - -ENTRYPOINT ["/bin/github-weather"] \ No newline at end of file +ENTRYPOINT ["/bin/github-weather"]