diff --git a/Dockerfile b/Dockerfile index f01d1e14a57a5a63d5d99da16db220676266eb84..25d719a3cceba9d6c32160648208ea20b8ccb83f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ -FROM golang - +FROM golang as builder RUN curl https://glide.sh/get | sh WORKDIR /go/src/app -COPY . . +COPY glide.lock glide.yaml ./ RUN glide install -RUN go build -a app . +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -a app . -ENTRYPOINT ["./app"] \ No newline at end of file +FROM scratch +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY --from=builder /go/src/app/app /app +ENTRYPOINT ["/app"] \ No newline at end of file