Use prometheus tooling to build docker container

It should be more aligned with how releases are (will be) built.
Ideally, we release container images as well, but this will not be in
place for the first release.
This commit is contained in:
Conrad Hoffmann 2019-10-18 11:42:15 +02:00
parent bbdab3989a
commit 6759fce7ed
1 changed files with 5 additions and 5 deletions

View File

@ -1,9 +1,9 @@
# Build /go/bin/ipmi_exporter
FROM golang:latest AS builder
FROM quay.io/prometheus/golang-builder:1.13-base AS builder
RUN go get github.com/soundcloud/ipmi_exporter \
RUN go get -d github.com/soundcloud/ipmi_exporter \
&& cd /go/src/github.com/soundcloud/ipmi_exporter \
&& go build
&& make
# Container image
@ -17,8 +17,8 @@ RUN apt-get update \
&& apt-get install freeipmi-tools -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /go/bin/ipmi_exporter /ipmi_exporter
COPY --from=builder /go/src/github.com/soundcloud/ipmi_exporter /bin/ipmi_exporter
EXPOSE 9290
CMD ["/ipmi_exporter", "--config.file", "/config.yml"]
CMD ["/bin/ipmi_exporter", "--config.file", "/config.yml"]