From e1a8c9182df108b49e6d13105938e9a146ed822d Mon Sep 17 00:00:00 2001 From: FreshMosh Date: Wed, 8 Sep 2021 15:04:55 +0200 Subject: [PATCH] Build Image from scratch --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0eea412..ce2d735 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ FROM golang:1.15-alpine WORKDIR /src -RUN apk --no-cache add git +RUN apk --no-cache add \ + git \ + ca-certificates COPY *.go go.mod go.sum ./ RUN CGO_ENABLED=0 GOOS=linux go build -o /bin/prometheus-ecs-discovery . -FROM alpine:latest -RUN apk --no-cache add ca-certificates +FROM scratch COPY --from=0 /bin/prometheus-ecs-discovery /bin/ +COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt ENTRYPOINT ["prometheus-ecs-discovery"]