monitoring/images/blackbox-exporter/Dockerfile

30 lines
1.2 KiB
Docker

FROM [[ .docker.repo ]][[ .docker.base_images.alpine.image ]] AS builder
ARG BLACKBOX_EXPORTER_VERSION=[[ .monitoring.exporters.blackbox.version ]]
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 [[ .docker.repo ]][[ .docker.base_images.alpine.image ]]
MAINTAINER [[ .docker.maintainer ]]
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}"]