From e44a69fc4de9782069fe5df1bff469e90fe685ad Mon Sep 17 00:00:00 2001 From: Johann Wagner Date: Mon, 26 Oct 2020 09:18:46 +0100 Subject: [PATCH] Added Dockerfile --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..168756a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# build stage +FROM golang:1.15 as builder +ENV GO111MODULE=on + +WORKDIR /app + +COPY go.mod . +COPY go.sum . + +RUN go mod download + +COPY . . + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o domainik-binary + +FROM alpine:3.10 as certs +RUN apk add ca-certificates && update-ca-certificates + +# final stage +FROM scratch +COPY --from=builder /app/domainik-binary /app/ +COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +ENTRYPOINT ["/app/domainik-binary"] \ No newline at end of file