From 92a04bd11d31083b8b287d70d3101082f413009a Mon Sep 17 00:00:00 2001 From: Grzegorz Bialas Date: Wed, 14 Aug 2024 13:46:34 +0200 Subject: [PATCH 1/3] upstream sync --- Dockerfile | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24198d6..0a096be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,25 @@ -FROM golang:alpine as builder -RUN apk add --no-cache git -RUN git clone https://github.com/jovial/redfish_exporter /build && cd /build && git checkout 59d1061fb0370cf72e1f813dfcc425f139be49d7 -WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o main . -FROM scratch -COPY --from=builder /build/main /app/ -WORKDIR /app -CMD ["./main"] +FROM golang:rc-bullseye AS builder +LABEL maintainer="Jennings Liu " + +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 mkdir -p /go/src/github.com/ && \ + git clone -b update_test https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \ + cd /go/src/github.com/stackhpc/redfish_exporter && \ + make build + +FROM golang:rc-bullseye + +COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter +RUN mkdir /etc/prometheus +COPY config.yml.example /etc/prometheus/redfish_exporter.yml +CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"] From 10c8bd1fc65d8ef0482f684061531a66f441cbe0 Mon Sep 17 00:00:00 2001 From: Grzegorz Bialas Date: Wed, 14 Aug 2024 14:09:16 +0200 Subject: [PATCH 2/3] update dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0a096be..c0e4e5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,5 @@ FROM golang:rc-bullseye COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter RUN mkdir /etc/prometheus -COPY config.yml.example /etc/prometheus/redfish_exporter.yml +COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/config.yml.example /etc/prometheus/redfish_exporter.yml CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"] From 75fa9e60564039808a5d2caedb9cfa6d122c7bb0 Mon Sep 17 00:00:00 2001 From: Grzegorz Bialas Date: Wed, 14 Aug 2024 14:25:45 +0200 Subject: [PATCH 3/3] update branch in dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c0e4e5d..1f7a730 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ ENV GO111MODULE=on # Build dependencies RUN mkdir -p /go/src/github.com/ && \ - git clone -b update_test https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \ + git clone -b stackhpc https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \ cd /go/src/github.com/stackhpc/redfish_exporter && \ make build