monitoring/example/images/blackbox-exporter/Dockerfile

30 lines
1.1 KiB
Docker

FROM danielberteaud/alpine:24.4-1 AS builder
ARG BLACKBOX_EXPORTER_VERSION=0.25.0
ADD https://github.com/prometheus/blackbox_exporter/releases/download/v${BLACKBOX_EXPORTER_VERSION}/blackbox_exporter-${BLACKBOX_EXPORTER_VERSION}.linux-amd64.tar.gz /tmp
ADD https://github.com/prometheus/blackbox_exporter/releases/download/v${BLACKBOX_EXPORTER_VERSION}/sha256sums.txt /tmp
RUN set -eux &&\
apk --no-cache add tar gzip &&\
cd /tmp &&\
grep "blackbox_exporter-${BLACKBOX_EXPORTER_VERSION}.linux-amd64.tar.gz" sha256sums.txt | sha256sum -c &&\
tar xvf blackbox_exporter-${BLACKBOX_EXPORTER_VERSION}.linux-amd64.tar.gz &&\
mkdir blackbox &&\
mv blackbox_exporter-${BLACKBOX_EXPORTER_VERSION}.linux-amd64/blackbox_exporter /usr/local/bin/blackbox_exporter
FROM danielberteaud/alpine:24.4-1
MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
ENV BLACKBOX_CONF=/etc/blackbox.yml
COPY --from=builder /usr/local/bin/blackbox_exporter /usr/local/bin/blackbox_exporter
RUN set -eux &&\
apk --no-cache upgrade &&\
apk --no-cache add ca-certificates curl
COPY root/ /
EXPOSE 9195
CMD ["sh", "-c", "exec blackbox_exporter --config.file=${BLACKBOX_CONF}"]