ntppool-exporter/Dockerfile
Adora Laura Kalb 15310ee2ff
All checks were successful
ci/woodpecker/push/golang-test Pipeline was successful
ci/woodpecker/pr/docker-deploy Pipeline was successful
switch docker image to distroless
2024-04-23 07:52:15 +02:00

31 lines
615 B
Docker

FROM golang:1.22-bullseye AS dev
COPY . /var/app
WORKDIR /var/app
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
RUN go mod download && go mod verify
RUN go build -o ntppool-exporter main.go
RUN chmod +x ntppool-exporter
FROM gcr.io/distroless/static-debian12 AS prod
WORKDIR /app
COPY --from=build /var/app/ntppool-exporter /bin/
LABEL maintainer="Adora Laura Kalb <adora@lila.network>"
EXPOSE 43609
ENTRYPOINT ["/bin/ntppool-exporter"]