-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
34 lines (24 loc) · 765 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
27
28
29
30
31
32
33
34
FROM golang:1.19.3-alpine as builder
WORKDIR /go/src/github.com/systemli/prometheus-jibri-exporter
ENV USER=appuser
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
ADD . /go/src/github.com/systemli/prometheus-jibri-exporter
RUN go get -d -v && \
go mod download && \
go mod verify && \
CGO_ENABLED=0 go build -ldflags="-w -s" -o /prometheus-jibri-exporter
FROM scratch
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY --from=builder /prometheus-jibri-exporter /prometheus-jibri-exporter
USER appuser:appuser
EXPOSE 9888
ENTRYPOINT ["/prometheus-jibri-exporter"]