ntppool-exporter/Dockerfile

33 lines
660 B
Text
Raw Permalink 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
FROM debian:12 AS prod
2024-04-17 15:34:23 +02:00
WORKDIR /app
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2024-04-17 15:34:23 +02:00
COPY --from=build /var/app/ntppool-exporter /bin/
LABEL maintainer="Adora Laura Kalb <adora@lila.network>"
EXPOSE 43609
ENTRYPOINT ["/bin/ntppool-exporter"]