Skip to content

Commit 4bdfc07

Browse files
authored
Update Dockerfile
Update to use the official golang image, centos8 is EOL. Golang image is also lighter and already comes with preinstalled dependencies.
1 parent 32fbb25 commit 4bdfc07

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/library/centos:8 AS builder
1+
FROM golang:rc-bullseye AS builder
22

33
LABEL maintainer="Jennings Liu <[email protected]>"
44

@@ -12,20 +12,14 @@ ENV GO111MODULE=on
1212

1313

1414
# Build dependencies
15-
16-
RUN yum update -y && \
17-
yum install -y rpm-build make git && \
18-
curl -SL https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz | tar -xzC /usr/local
1915
RUN mkdir -p /go/src/github.com/ && \
2016
git clone https://github.com/jenningsloy318/redfish_exporter /go/src/github.com/jenningsloy318/redfish_exporter && \
2117
cd /go/src/github.com/jenningsloy318/redfish_exporter && \
2218
make build
2319

24-
FROM docker.io/library/centos:8
20+
FROM golang:rc-bullseye
2521

2622
COPY --from=builder /go/src/github.com/jenningsloy318/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
2723
RUN mkdir /etc/prometheus
2824
COPY config.yml.example /etc/prometheus/redfish_exporter.yml
2925
CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"]
30-
31-

0 commit comments

Comments
 (0)