Skip to content

Commit

Permalink
Merge pull request #8 from RubenHoms/add-docker-prod-image
Browse files Browse the repository at this point in the history
Add multi-stage Dockerfile for production builds
  • Loading branch information
RubenHoms authored Sep 27, 2019
2 parents 07a1959 + 2b2beb4 commit ecd5b9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# IDE specific files
.idea/
.idea/
maxscale_exporter
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
FROM quay.io/prometheus/busybox:latest
MAINTAINER The Prometheus Authors <[email protected]>
FROM golang:1.8 AS build

COPY maxscale_exporter /bin/maxscale_exporter
WORKDIR /go/src/app
COPY . .
RUN go get -d -v ./...
RUN go install -v ./...
RUN go get github.com/RubenHoms/maxscale_exporter
RUN make build

ENTRYPOINT ["/bin/maxscale_exporter"]
USER nobody
EXPOSE 9195
FROM alpine:3.10

COPY --from=build /go/src/app/maxscale_exporter /bin/maxscale_exporter
USER nobody
EXPOSE 9195
ENTRYPOINT ["/bin/maxscale_exporter"]

0 comments on commit ecd5b9f

Please sign in to comment.