blob: 0cf606ad1fe28f1a1f563b311f12f07e68e76ef3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
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
|