Skip to content

Instantly share code, notes, and snippets.

@chokri
Created November 4, 2025 23:13
Show Gist options
  • Select an option

  • Save chokri/01d90e99a76686e3a0b3371e89050430 to your computer and use it in GitHub Desktop.

Select an option

Save chokri/01d90e99a76686e3a0b3371e89050430 to your computer and use it in GitHub Desktop.
Blackbox Exporter Dockerfile
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