kolla/docker/prometheus/prometheus-libvirt-exporter/Dockerfile.j2
Marcin Juszkiewicz 878b00013b Move to CentOS Stream 9
OpenStack 'zed' requires Python 3.8+ so RHEL 8 family has to go.

This changeset moves to CentOS Stream 9 while move to RockyLinux 9 is
planned as final solution.

CI moved to CentOS Stream 9 nodes.

Depends-on: https://review.opendev.org/c/openstack/kolla-ansible/+/839715

Change-Id: I113b9984294cf8663d3fc0c8840320e1d40ea731
2022-09-27 07:40:06 +00:00

50 lines
1.4 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['crb']) }}
{% block prometheus_libvirt_exporter_header %}{% endblock %}
{% if base_package_type == 'rpm' %}
{% set prometheus_libvirt_exporter_packages = [
'git',
'go',
'libvirt-devel',
] %}
{% elif base_package_type == 'deb' %}
{% set prometheus_libvirt_exporter_packages = [
'build-essential',
'git',
'golang-go',
'libvirt-dev',
'pkg-config',
] %}
{% endif %}
{{ macros.install_packages(prometheus_libvirt_exporter_packages | customizable("packages")) }}
{% block prometheus_libvirt_exporter_version %}
ARG prometheus_libvirt_exporter_version=2.3.2
ARG prometheus_libvirt_exporter_path=github.com/AlexZzz/libvirt-exporter
{% endblock %}
{% block prometheus_libvirt_exporter_install %}
ENV GOPATH=/build
RUN go mod init libvirt-exporter \
&& cd ${GOPATH} \
&& go get -v ${prometheus_libvirt_exporter_path}@${prometheus_libvirt_exporter_version} \
&& go build ${prometheus_libvirt_exporter_path} \
&& mv /build/libvirt-exporter /opt \
&& rm -rf /build
{% endblock %}
{% block prometheus_libvirt_exporter_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER root