forked from missionlane/prometheus-mailgun-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (23 loc) · 854 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM golang:alpine as builder
WORKDIR /go/src/app
ARG BUILD_DATE
ARG BUILD_USER
ARG GIT_BRANCH
ARG GIT_REVISION
ARG GO111MODULE
ARG VERSION
COPY . .
RUN apk --update --no-cache add git && \
go mod tidy && \
go install \
-ldflags "-X github.com/prometheus/common/version.BuildDate=${BUILD_DATE} \
-X github.com/prometheus/common/version.BuildUser=${BUILD_USER} \
-X github.com/prometheus/common/version.Branch=${GIT_BRANCH} \
-X github.com/prometheus/common/version.Revision=${GIT_REVISION} \
-X github.com/prometheus/common/version.Version=${VERSION}"
FROM alpine:latest
RUN apk --update --no-cache add ca-certificates
ENTRYPOINT ["/mailgun-exporter"]
EXPOSE 9616/tcp
USER nobody
COPY --from=builder /go/bin/mailgun-exporter .