kolla/docker/prometheus/prometheus-blackbox-exporter/Dockerfile.j2
Michal Nasiadka 750a137815 Move curl sources to sources.py
Move most curl sources to sources.py, so it can be automatically
updated in future.

This also makes overriding the versions/locations/sha256 easier.

Change-Id: Ib3497fe96162ae190e5c113cacaaa3ef8334f590
2024-02-21 08:26:52 +00:00

35 lines
1.1 KiB
Django/Jinja

FROM {{ namespace }}/{{ 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 %}
{% 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 %}
ADD prometheus-blackbox-exporter-archive /prometheus-blackbox-exporter-source
RUN ln -s /prometheus-blackbox-exporter-source/* prometheus-blackbox-exporter \
&& mkdir -p /opt/blackbox_exporter/ \
&& cp /prometheus-blackbox-exporter/blackbox_exporter /opt/blackbox_exporter/ \
&& setcap cap_net_raw+ep /opt/blackbox_exporter/blackbox_exporter
{% endblock %}
{% block prometheus_blackbox_exporter_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER prometheus