ipmi_exporter/Dockerfile
Conrad Hoffmann 9243e9fc9f Misc fixes for the Dockerfile
- Copy local repo when building instead of using go get
 - Fix accidentally copying dir instead of executable to final container
 - Use combination of ENTRYPOINT and CMD as preset

Fixes #37, #38.
2019-10-26 15:24:52 +02:00

18 lines
552 B
Docker

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