prometheus-libvirt-exporter: fix build with newer Go

I have no idea how Go works. This change make build happen.

Change-Id: I09ea136c7354143f45f856d5e8d8ed1192879622
(cherry picked from commit 9630032fd6)
This commit is contained in:
Marcin Juszkiewicz 2022-05-06 10:25:22 +02:00 committed by Radosław Piliszek
parent 782d02dcb4
commit 52375aeea7
1 changed files with 3 additions and 1 deletions

View File

@ -33,8 +33,10 @@ ARG prometheus_libvirt_exporter_path=github.com/AlexZzz/libvirt-exporter
{% 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} \
&& mv /build/bin/libvirt-exporter /opt \
&& go build ${prometheus_libvirt_exporter_path} \
&& mv /build/libvirt-exporter /opt \
&& rm -rf /build
{% endblock %}