Skip to content

Commit

Permalink
Disable CGO for php-fpm-exporter build.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksantamaria authored Nov 6, 2024
1 parent ed72ae2 commit 4bb71f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion images/php-fpm-exporter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM golang:latest as builder
RUN git clone https://github.com/hipages/php-fpm_exporter.git /workspace
WORKDIR /workspace
RUN make deps
ENV CGO_ENABLED=0
RUN TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}; \
GOOS=${TARGETPLATFORM%%/*} GOARCH=${TARGETPLATFORM#*/} go build -o php-fpm-exporter -ldflags='-extldflags "-static"' .

Expand All @@ -15,4 +16,4 @@ EXPOSE 9253
COPY --from=builder /workspace/php-fpm-exporter .
USER nonroot:nonroot
ENTRYPOINT ["/php-fpm-exporter"]
CMD ["server"]
CMD ["server"]

0 comments on commit 4bb71f6

Please sign in to comment.