From c24b2008403a411d99fd8ca93819248d552b167f Mon Sep 17 00:00:00 2001 From: Elias Souza Date: Thu, 5 Oct 2023 12:08:50 -0300 Subject: [PATCH 1/3] chore: fix dockerfile --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index dace6dcce..7249ea195 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,11 +7,13 @@ ENV GOARCH=amd64 RUN make release RUN chmod +x postgres_exporter && mv postgres_exporter /tmp/postgres_exporter + FROM quay.io/prometheus/busybox:latest as final -LABEL maintainer="The Prometheus Authors " -COPY --from=build ["/tmp/postgres_exporter", "/bin/postgres_exporter" ] +COPY --from=build ["/tmp/postgres_exporter", "/" ] + +WORKDIR /opt/exporter + +EXPOSE 9187 -EXPOSE 9187 -USER nobody -ENTRYPOINT [ "/bin/postgres_exporter" ] +ENTRYPOINT [ "/postgres_exporter" ] From c7b0990af77928d2383f805ff634d73a2faaea2e Mon Sep 17 00:00:00 2001 From: Elias Souza Date: Thu, 5 Oct 2023 13:02:25 -0300 Subject: [PATCH 2/3] chore: fix dockerfile --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7249ea195..1c6bd03f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,11 @@ FROM golang:1.19-alpine as build WORKDIR ${GOPATH}/src/github.com/quintoandar RUN apk update && apk add make git curl && git clone --branch main https://github.com/quintoandar/postgres_exporter.git WORKDIR ${GOPATH}/src/github.com/quintoandar/postgres_exporter -ENV GOARCH=amd64 RUN make release RUN chmod +x postgres_exporter && mv postgres_exporter /tmp/postgres_exporter -FROM quay.io/prometheus/busybox:latest as final +FROM alpine as final COPY --from=build ["/tmp/postgres_exporter", "/" ] From 2905bc0f65b1568807a8ee27dc233ad5349fdf21 Mon Sep 17 00:00:00 2001 From: Elias Souza Date: Thu, 5 Oct 2023 13:03:28 -0300 Subject: [PATCH 3/3] chore: fix dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1c6bd03f8..745e19912 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN make release RUN chmod +x postgres_exporter && mv postgres_exporter /tmp/postgres_exporter -FROM alpine as final +FROM quay.io/prometheus/busybox:latest as final COPY --from=build ["/tmp/postgres_exporter", "/" ]