Skip to content

Instantly share code, notes, and snippets.

@mingalevme
Last active July 8, 2021 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingalevme/28642bf1160a760f024d5155259d32a4 to your computer and use it in GitHub Desktop.
Save mingalevme/28642bf1160a760f024d5155259d32a4 to your computer and use it in GitHub Desktop.
hipages/php-fpm_exporter with
#
# docker build --target php-fpm_exporter -t php-fpm_exporter .
#
FROM golang:alpine AS builder
RUN apk add --update git
WORKDIR /php-fpm_exporter
RUN true && \
git config --global user.email "user@example.com" && \
git clone 'https://github.com/hipages/php-fpm_exporter.git' . && \
git remote add stanxing https://github.com/stanxing/php-fpm_exporter.git && \
git fetch stanxing && \
#git merge stanxing/master && \
git merge b07958e01e33a4bd8df20531865ff9ae14859bff && \
go build . && \
chmod a+x php-fpm_exporter
FROM alpine AS php-fpm_exporter
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="php-fpm_exporter" \
org.label-schema.description="A prometheus exporter for PHP-FPM." \
org.label-schema.url="https://hipages.com.au/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/hipages/php-fpm_exporter" \
org.label-schema.vendor="hipages" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
org.label-schema.docker.cmd="docker run -it --rm -e PHP_FPM_SCRAPE_URI=\"tcp://127.0.0.1:9000/status\" hipages/php-fpm_exporter"
COPY --from=builder /php-fpm_exporter/php-fpm_exporter /php-fpm_exporter
EXPOSE 9253
ENTRYPOINT [ "/php-fpm_exporter" ]
CMD [ "server" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment