File tree Expand file tree Collapse file tree 1 file changed +24
-9
lines changed Expand file tree Collapse file tree 1 file changed +24
-9
lines changed Original file line number Diff line number Diff line change 1- FROM golang:alpine as builder
2- RUN apk add --no-cache git
3- RUN git clone https://github.com/jovial/redfish_exporter /build && cd /build && git checkout 59d1061fb0370cf72e1f813dfcc425f139be49d7
4- WORKDIR /build
5- RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o main .
6- FROM scratch
7- COPY --from=builder /build/main /app/
8- WORKDIR /app
9- CMD ["./main" ]
1+ FROM golang:rc-bullseye AS builder
102
3+ LABEL maintainer="Jennings Liu <jenningsloy318@gmail.com>"
4+
5+ ARG ARCH=amd64
6+
7+ ENV GOROOT /usr/local/go
8+ ENV GOPATH /go
9+ ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
10+ ENV GO_VERSION 1.15.2
11+ ENV GO111MODULE=on
12+
13+
14+ # Build dependencies
15+ RUN mkdir -p /go/src/github.com/ && \
16+ git clone -b stackhpc https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \
17+ cd /go/src/github.com/stackhpc/redfish_exporter && \
18+ make build
19+
20+ FROM golang:rc-bullseye
21+
22+ COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
23+ RUN mkdir /etc/prometheus
24+ COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/config.yml.example /etc/prometheus/redfish_exporter.yml
25+ CMD ["/usr/local/bin/redfish_exporter" ,"--config.file" ,"/etc/prometheus/redfish_exporter.yml" ]
You can’t perform that action at this time.
0 commit comments