From 3be40df15ed1f44f341c35d27218897688e10cf4 Mon Sep 17 00:00:00 2001 From: 12ww1160 Date: Tue, 2 Dec 2025 15:18:53 +0100 Subject: [PATCH] OP#176 edit Dockerfile RUN step --- Dockerfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index aef72d8..14e8e93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,22 +4,20 @@ FROM golang:1.22-alpine AS builder RUN apk add --no-cache git make gcc musl-dev WORKDIR /src - -# Copy your local source (you already have it) COPY . . -# fix go mod +# Fix missing go.sum entries RUN go mod tidy -# Build the binary +# Build (default target = all) RUN make -# Verify it was built +# Verify binary exists and is executable — no --version check RUN ls -la postgresql-prometheus-adapter && \ - ./postgresql-prometheus-adapter --version + ./postgresql-prometheus-adapter --help > /dev/null -# ───── Stage 2: Tiny, secure, non-root runtime ───── +# ───── Stage 2: Tiny runtime ───── FROM gcr.io/distroless/static-debian12 COPY --from=builder /src/postgresql-prometheus-adapter /usr/local/bin/postgresql-prometheus-adapter