diff --git a/Dockerfile b/Dockerfile index c4d36f4..c403213 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.22 AS build +FROM --platform=$BUILDPLATFORM docker.io/golang:1.22 AS build WORKDIR /app @@ -20,7 +20,12 @@ RUN echo "Building BUILDPLATFORM: '${BUILDPLATFORM}', TARGETPLATFORM: '$TARGETPL echo "Building for $GOOS/$GOARCH/$GOARM"; \ go build -ldflags="-s -w" -o ./custom-exporter . +FROM --platform=$BUILDPLATFORM docker.io/alpine:3.20.0 AS certificates + +RUN apk add --no-cache ca-certificates + FROM scratch +COPY --from=certificates /etc/ssl /etc/ssl COPY --from=build /app/custom-exporter /custom-exporter -ENTRYPOINT ["/custom-exporter"] \ No newline at end of file +ENTRYPOINT ["/custom-exporter"]