Files
kolla/docker/prometheus/prometheus-blackbox-exporter/Dockerfile.j2
Michał Nasiadka 22c32a30e6 Unify curl options
Currently we use couple of curl options throughout Dockerfiles, this change
adds all common options to curlrc (-sSLf) and removes usage of those in
Dockerfiles.

Change-Id: I46b77978926fc2b578a68d1aaa944b2198af0685
2020-12-02 18:48:22 +01:00

38 lines
1.3 KiB
Django/Jinja

FROM {{ namespace }}/{{ infra_image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}
{% block prometheus_blackbox_exporter_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% block prometheus_blackbox_exporter_repository_version %}
ENV blackbox_exporter_version=0.16.0
{% endblock %}
{% if base_package_type == 'rpm' %}
{% set blackbox_packages = [
'libcap'
] %}
{% elif base_package_type == 'deb' %}
{% set blackbox_packages = [
'libcap2-bin'
] %}
{% endif %}
{{ macros.install_packages(blackbox_packages | customizable("packages")) }}
{% block prometheus_blackbox_exporter_install %}
RUN curl -o /tmp/blackbox_exporter.tar.gz https://github.com/prometheus/blackbox_exporter/releases/download/v${blackbox_exporter_version}/blackbox_exporter-${blackbox_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/blackbox_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/blackbox_exporter.tar.gz \
&& ln -s /opt/blackbox_exporter* /opt/blackbox_exporter
RUN setcap cap_net_raw+ep /opt/blackbox_exporter/blackbox_exporter
{% endblock %}
{% block prometheus_blackbox_exporter_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER prometheus