prometheus-jitsi-meet-exporter/Dockerfile

37 lines
927 B
Docker
Raw Normal View History

FROM golang:1.17.0-alpine as builder
2021-03-12 11:15:13 +01:00
2020-03-21 20:53:50 +01:00
WORKDIR /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
2021-03-12 11:15:13 +01:00
ENV USER=appuser
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
2020-03-21 20:53:50 +01:00
ADD . /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
2021-04-25 17:58:19 +02:00
RUN apk --update add ca-certificates && \
go get -d -v && \
2021-03-12 11:15:13 +01:00
go mod download && \
go mod verify && \
CGO_ENABLED=0 go build -ldflags="-w -s" -o /prometheus-jitsi-meet-exporter
2020-03-21 20:53:50 +01:00
2021-03-12 11:15:13 +01:00
FROM scratch
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
2021-04-25 17:58:19 +02:00
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2021-03-12 11:15:13 +01:00
COPY --from=builder /prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
USER appuser:appuser
2020-03-21 20:53:50 +01:00
EXPOSE 9888
2021-03-12 11:15:13 +01:00
2020-03-21 20:53:50 +01:00
ENTRYPOINT ["/prometheus-jitsi-meet-exporter"]