diff --git a/Dockerfile b/Dockerfile index 49119c7..c7efe80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,15 @@ -FROM alpine:latest -MAINTAINER CMogilko - -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 -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" ]