-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (22 loc) · 996 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM docker.io/library/centos:7 AS builder
LABEL maintainer="Matt Goble <matt.goble@hotmail.co.nz>"
ARG ARCH=amd64
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
ENV GO_VERSION 1.15.2
ENV GO111MODULE=on
# Build dependencies
RUN yum update -y && \
yum install -y rpm-build make git && \
curl -SL https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz | tar -xzC /usr/local
RUN mkdir -p /go/src/github.com/ && \
git clone https://github.com/mjgoble/redfish_exporter /go/src/github.com/mjgoble/redfish_exporter && \
cd /go/src/github.com/mjgoble/redfish_exporter && \
make build
FROM docker.io/library/centos:7
COPY --from=builder /go/src/github.com/mjgoble/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
RUN mkdir /etc/prometheus
COPY config.yml.example /etc/prometheus/redfish_exporter.yml
ENTRYPOINT [ "/usr/local/bin/redfish_exporter" ]
CMD ["--config.file=/etc/prometheus/redfish_exporter.yml"]