Skip to content

Commit

Permalink
Merge pull request #2 from mterzo/master
Browse files Browse the repository at this point in the history
Reduce size of docker image
  • Loading branch information
CMogilko authored Oct 20, 2020
2 parents c1d6b1b + 8240c42 commit e957b8e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM alpine:latest
MAINTAINER CMogilko <[email protected]>

RUN apk add --update -t build-deps go git make
FROM golang:1.14.0 as build

COPY . /src
RUN set -ex \
&& cd /src \
&& CGO_ENABLED=0 go build -o /bin/prometheus-exporter

RUN cd /src && go build -o /bin/prometheus-exporter
RUN rm -rf /src
FROM alpine:latest
MAINTAINER CMogilko <[email protected]>

RUN apk del --purge build-deps go git make
COPY --from=build /bin/prometheus-exporter /bin/prometheus-exporter

USER nobody
EXPOSE 9055
ENTRYPOINT [ "/bin/prometheus-exporter" ]

0 comments on commit e957b8e

Please sign in to comment.