diff --git a/build/Dockerfile b/build/Dockerfile index 3cdc6fed..202a651b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -9,7 +9,7 @@ COPY vendor ./vendor COPY go.mod go.sum ./ COPY collector ./collector COPY client ./client -RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -mod=vendor -a -ldflags "-X main.version=${VERSION} -X main.commit=${GIT_COMMIT}" -o exporter . +RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -mod=vendor -a -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${GIT_COMMIT}" -o exporter . FROM gcr.io/distroless/static:latest COPY --from=builder /go/src/github.com/nginxinc/nginx-prometheus-exporter/exporter /usr/bin/