01f8569011
COPY in the Dockerfile has been moved so that changes to the source code do not cause an apt update unnecessarily. A build script has aslo been added to build and extract the build artefacts. This build script is usedby Ansible to deploy the application to compute hosts. Change-Id: I66d2b671d991d1ce3bef544532b058d33f32d282 Create build script which exports the build artefacts Change-Id: Ifa1458a6b17484d378ec14b4cba2e0493b722f7b Make build script fail if any of the stages fail Change-Id: I325cf2d44f40f19a198bc03858625add20e10494
15 lines
364 B
Docker
15 lines
364 B
Docker
FROM golang:1.13.5 AS builder
|
|
WORKDIR /go/src/app
|
|
RUN apt-get update && \
|
|
apt-get -y install libvirt-dev && \
|
|
apt-get clean all
|
|
COPY . .
|
|
RUN go build
|
|
|
|
FROM golang:1.13.5
|
|
RUN apt-get update && \
|
|
apt-get -y install libvirt0 && \
|
|
apt-get clean all
|
|
COPY --from=builder /go/src/app/libvirtd_exporter /libvirtd_exporter
|
|
ENTRYPOINT ["/libvirtd_exporter"]
|