From bbcb742f12c5d198a1579a5bd61ea4603f5731ec Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 8 Aug 2024 13:05:31 -0400 Subject: [PATCH] CARRY: use golang version workaround for ubi9 image Signed-off-by: Kevin --- Dockerfile.rhoai | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Dockerfile.rhoai b/Dockerfile.rhoai index cb2fcee4df..dfccf49ef1 100644 --- a/Dockerfile.rhoai +++ b/Dockerfile.rhoai @@ -1,9 +1,23 @@ -# Build the manager binary -FROM registry.access.redhat.com/ubi9/go-toolset:1.21 as builder +# Start of Go versioning workaround for lack of go-toolset for version 1.22 +FROM registry-proxy.engineering.redhat.com/rh-osbs/openshift-golang-builder:v1.22.2 AS golang -WORKDIR /workspace +FROM registry.access.redhat.com/ubi9/ubi:latest AS builder + +ARG GOLANG_VERSION=1.22.2 + +# Install system dependencies +RUN dnf upgrade -y && dnf install -y \ + gcc \ + make \ + openssl-devel \ + && dnf clean all && rm -rf /var/cache/yum -RUN git config --global --add safe.directory /workspace +# Install Go +ENV PATH=/usr/local/go/bin:$PATH + +COPY --from=golang /usr/lib/golang /usr/local/go + +WORKDIR /workspace # Copy the Go Modules manifests COPY go.mod go.mod