Created
November 4, 2025 23:13
-
-
Save chokri/01d90e99a76686e3a0b3371e89050430 to your computer and use it in GitHub Desktop.
Blackbox Exporter Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM golang:1.24-alpine AS builder | |
| RUN apk add --no-cache git make curl | |
| WORKDIR /build | |
| RUN git clone https://github.com/prometheus/blackbox_exporter.git . | |
| RUN make build | |
| FROM alpine:latest | |
| RUN apk add --no-cache ca-certificates | |
| COPY --from=builder /build/blackbox_exporter /bin/blackbox_exporter | |
| COPY --from=builder /build/blackbox.yml /etc/blackbox_exporter/config.yml | |
| EXPOSE 9115 | |
| RUN addgroup -S blackbox && adduser -S -G blackbox blackbox | |
| USER blackbox | |
| ENTRYPOINT ["/bin/blackbox_exporter"] | |
| CMD ["--config.file=/etc/blackbox_exporter/config.yml"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment