diff --git a/Containerfile b/Containerfile index f627193..76ae3a9 100644 --- a/Containerfile +++ b/Containerfile @@ -1,12 +1,17 @@ -FROM docker.io/library/golang:1.21 AS build +FROM docker.io/library/golang:1.21-alpine AS build + +RUN --mount=type=cache,target=/var/cache \ + apk add \ + git \ + && : RUN go install github.com/lucab/local_exporter@latest -FROM registry.fedoraproject.org/fedora-minimal:38 +FROM scratch -COPY --from=build /go/bin/local_exporter /usr/local/bin/local_exporter +COPY --from=build /go/bin/local_exporter /local_exporter -ENTRYPOINT ["local_exporter"] +ENTRYPOINT ["/local_exporter"] USER 252:252