From 88e38d82129b94706c42f4b8b7c00d1e2de06717 Mon Sep 17 00:00:00 2001 From: Matt Anson Date: Mon, 17 Feb 2025 14:23:40 +0000 Subject: [PATCH] Build updated commit in StackHPC fork Pin to a specific commit in the stackhpc fork of redfish_exporter, and update the golang image to contain Go 1.21, which is required to build this commit. --- Dockerfile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f7a730..17a2e18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,17 @@ -FROM golang:rc-bullseye AS builder +FROM golang:1.21 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 +# Build binary RUN mkdir -p /go/src/github.com/ && \ - git clone -b stackhpc https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \ + git clone https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \ cd /go/src/github.com/stackhpc/redfish_exporter && \ + git checkout d963088baa0fd477878d7263d15f8507624c3172 && \ make build -FROM golang:rc-bullseye +FROM golang:1.21 COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter RUN mkdir /etc/prometheus