Use multi-stage build to get a small docker image
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ask Bjørn Hansen 2021-09-05 01:22:07 -07:00
parent 8dcd487a6a
commit 99fca5fe84

View File

@ -1,8 +1,10 @@
FROM golang:1.17-alpine
FROM golang:1.17-alpine AS build
WORKDIR /app
COPY . ./
RUN go mod download
RUN go build -o /bin/prometheus-dnssec-exporter
ENTRYPOINT [ "/bin/prometheus-dnssec-exporter" ]
FROM alpine:3.14.2
COPY --from=build /bin/prometheus-dnssec-exporter /bin/prometheus-dnssec-exporter
ENTRYPOINT [ "/bin/prometheus-dnssec-exporter" ]