Skip to content

Commit

Permalink
Updated Dockerfile to build from scratch, decrease size from 17M to 9M
Browse files Browse the repository at this point in the history
  • Loading branch information
eko committed Jun 14, 2019
1 parent eb938db commit daa4b0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Expand Up @@ -7,13 +7,14 @@ RUN apk update && \
apk --no-cache add git alpine-sdk

RUN GO111MODULE=on go mod vendor
RUN GOOS=linux go build -o binary ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w' -o binary ./

FROM alpine
FROM scratch

LABEL name="pihole-exporter"

WORKDIR /root/

COPY --from=builder /go/src/github.com/eko/pihole-exporter/binary pihole-exporter

CMD ["./pihole-exporter"]

0 comments on commit daa4b0b

Please sign in to comment.