82ee1e6319
This changeset adds support for CentOS Stream 9. Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/864920 Change-Id: I113b9984294cf8663d3fc0c8840320e1d40ea731 (cherry picked from commit 878b00013b01e3d02a704ce7c9fac1629cd1a705)
50 lines
1.4 KiB
Django/Jinja
50 lines
1.4 KiB
Django/Jinja
FROM {{ namespace }}/{{ infra_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.0
|
|
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
|