From f2e0012683a154b89ab54dae0c8fab7e6307a382 Mon Sep 17 00:00:00 2001 From: 12ww1160 Date: Tue, 2 Dec 2025 15:31:08 +0100 Subject: [PATCH] OP#176 edit Dockerfile stage 2 --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14e8e93..a62e73b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,16 +17,22 @@ RUN ls -la postgresql-prometheus-adapter && \ ./postgresql-prometheus-adapter --help > /dev/null -# ───── Stage 2: Tiny runtime ───── -FROM gcr.io/distroless/static-debian12 +# ───── Stage 2: Runtime (Alpine = has glibc + loader) ───── +FROM alpine:3.20 + +# Install only what the binary needs (tiny) +RUN apk add --no-cache libc6-compat COPY --from=builder /src/postgresql-prometheus-adapter /usr/local/bin/postgresql-prometheus-adapter +# Make sure it's executable (just in case) +RUN chmod +x /usr/local/bin/postgresql-prometheus-adapter + USER 1001:1001 EXPOSE 9201 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD ["/usr/local/bin/postgresql-prometheus-adapter", "--health"] || exit 1 + CMD ["wget", "--spider", "-q", "http://127.0.0.1:9201/health"] || exit 1 ENTRYPOINT ["/usr/local/bin/postgresql-prometheus-adapter"] \ No newline at end of file