Update Dockerfile

This commit is contained in:
Daniel Czerwonk 2020-01-10 15:48:02 +01:00 committed by GitHub
parent 25ef739b20
commit 6ba0275f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,12 @@
FROM golang as builder
RUN go get -d -v github.com/czerwonk/bird_exporter
WORKDIR /go/src/github.com/czerwonk/bird_exporter
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
ADD . /go/bird_exporter/
WORKDIR /go/bird_exporter
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/bird_exporter
FROM alpine:latest
RUN apk --no-cache add ca-certificates bash
WORKDIR /app
COPY --from=builder /go/src/github.com/czerwonk/bird_exporter/app bird_exporter
COPY --from=builder /go/bin/bird_exporter .
EXPOSE 9324
ENTRYPOINT ["/app/bird_exporter"]