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.
This commit is contained in:
parent
f76900aa23
commit
9243e9fc9f
17
Dockerfile
17
Dockerfile
|
@ -1,24 +1,17 @@
|
||||||
# Build /go/bin/ipmi_exporter
|
# Build /go/bin/ipmi_exporter
|
||||||
FROM quay.io/prometheus/golang-builder:1.13-base AS builder
|
FROM quay.io/prometheus/golang-builder:1.13-base AS builder
|
||||||
|
ADD . /go/src/github.com/soundcloud/ipmi_exporter/
|
||||||
RUN go get -d github.com/soundcloud/ipmi_exporter \
|
RUN cd /go/src/github.com/soundcloud/ipmi_exporter && make
|
||||||
&& cd /go/src/github.com/soundcloud/ipmi_exporter \
|
|
||||||
&& make
|
|
||||||
|
|
||||||
|
|
||||||
# Container image
|
# Container image
|
||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
LABEL maintainer="Aggelos Kolaitis <neoaggelos@gmail.com>"
|
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install freeipmi-tools -y --no-install-recommends \
|
&& apt-get install freeipmi-tools -y --no-install-recommends \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY --from=builder /go/src/github.com/soundcloud/ipmi_exporter /bin/ipmi_exporter
|
COPY --from=builder /go/src/github.com/soundcloud/ipmi_exporter/ipmi_exporter /bin/ipmi_exporter
|
||||||
|
|
||||||
EXPOSE 9290
|
EXPOSE 9290
|
||||||
|
ENTRYPOINT ["/bin/ipmi_exporter"]
|
||||||
CMD ["/bin/ipmi_exporter", "--config.file", "/config.yml"]
|
CMD ["--config.file", "/config.yml"]
|
||||||
|
|
Loading…
Reference in New Issue