ntppool-exporter/Dockerfile

32 lines
615 B
Text
Raw Normal View History

FROM golang:1.22-bullseye AS dev
2024-04-17 15:34:23 +02:00
COPY . /var/app
WORKDIR /var/app
2024-04-17 15:34:23 +02:00
ENV GO111MODULE="on" \
CGO_ENABLED=0 \
GOOS=linux
EXPOSE 80
ENTRYPOINT ["sh"]
FROM dev as build
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes ca-certificates
2024-04-17 15:34:23 +02:00
RUN go mod download && go mod verify
RUN go build -o ntppool-exporter main.go
2024-04-17 15:34:23 +02:00
RUN chmod +x ntppool-exporter
2024-04-23 07:52:15 +02:00
FROM gcr.io/distroless/static-debian12 AS prod
2024-04-17 15:34:23 +02:00
WORKDIR /app
COPY --from=build /var/app/ntppool-exporter /bin/
LABEL maintainer="Adora Laura Kalb <adora@lila.network>"
EXPOSE 43609
ENTRYPOINT ["/bin/ntppool-exporter"]