From 4c0349cbe922c8718e3acd566ca073021870d6a3 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 17 Oct 2023 14:58:10 +0200 Subject: [PATCH] images: Update golang base image There is no version of registry.access.redhat.com/ubi8/go-toolset with golang 1.20: ``` $ podman build -f ./images/build-e2e/Dockerfile . [1/2] STEP 1/5: FROM registry.access.redhat.com/ubi8/go-toolset:1.20 AS builder Trying to pull registry.access.redhat.com/ubi8/go-toolset:1.20... Error: creating build container: initializing source docker://registry.access.redhat.com/ubi8/go-toolset:1.20: reading manifest 1.20 in registry.access.redhat.com/ubi8/go-toolset: manifest unknown ``` This commit switches to registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.20-openshift-4.15 which has golang 1.20 and is usable without authentication. This stays on a rhel8 image as some of the test nodes are still using rhel8, and building on a rhel9 node, and trying to run on a rhel8 node is not possible (some libc linking issues at startup). The builds will be noisy until https://github.com/openshift-eng/art-tools/pull/115 is merged and gets into these images. If needed, we can set GO_COMPLIANCE_INFO=0 in the images environment to make the build more quiet. --- images/build-e2e/Dockerfile | 2 +- images/build-integration/Dockerfile | 2 +- images/build/Dockerfile | 2 +- images/openshift-ci/Dockerfile | 2 +- update-go-version.sh | 4 +--- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/images/build-e2e/Dockerfile b/images/build-e2e/Dockerfile index 1bb73dfa95..c52470165e 100644 --- a/images/build-e2e/Dockerfile +++ b/images/build-e2e/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.20 as builder +FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.20-openshift-4.15 AS builder USER root WORKDIR /workspace diff --git a/images/build-integration/Dockerfile b/images/build-integration/Dockerfile index 0fed2a2620..ce78e75c43 100644 --- a/images/build-integration/Dockerfile +++ b/images/build-integration/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.20 as builder +FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.20-openshift-4.15 AS builder USER root WORKDIR /workspace diff --git a/images/build/Dockerfile b/images/build/Dockerfile index 267e69d34e..d73dfdd51d 100644 --- a/images/build/Dockerfile +++ b/images/build/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.14.12 +FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.20-openshift-4.15 MAINTAINER CRC WORKDIR $APP_ROOT/src diff --git a/images/openshift-ci/Dockerfile b/images/openshift-ci/Dockerfile index 77f5dfc5ea..395c594ea1 100644 --- a/images/openshift-ci/Dockerfile +++ b/images/openshift-ci/Dockerfile @@ -1,7 +1,7 @@ # This Dockerfile is used by openshift CI # It builds an image containing crc and nss-wrapper for remote deployments, as well as the google cloud-sdk for nested GCE environments. -FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS builder +FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.20-openshift-4.15 AS builder WORKDIR /go/src/github.com/crc-org/crc COPY . . RUN make release diff --git a/update-go-version.sh b/update-go-version.sh index 9fac0c57e5..2b567c50b5 100755 --- a/update-go-version.sh +++ b/update-go-version.sh @@ -11,9 +11,7 @@ echo "Updating golang version to $golang_base_version" go mod edit -go ${golang_base_version} go mod edit -go ${golang_base_version} tools/go.mod -sed -i "s,^FROM registry.ci.openshift.org/openshift/release:golang-1\... AS builder\$,FROM registry.ci.openshift.org/openshift/release:golang-${golang_base_version} AS builder," images/openshift-ci/Dockerfile -sed -i "s,^FROM registry.access.redhat.com/ubi8/go-toolset:[.0-9]\+ as builder\$,FROM registry.access.redhat.com/ubi8/go-toolset:${golang_base_version} as builder," images/build-e2e/Dockerfile -sed -i "s,^FROM registry.access.redhat.com/ubi8/go-toolset:[.0-9]\+ as builder\$,FROM registry.access.redhat.com/ubi8/go-toolset:${golang_base_version} as builder," images/build-integration/Dockerfile +sed -i "s,^\(FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-\)1.[0-9]\+,\1${golang_base_version}," images/*/Dockerfile for f in .github/workflows/*.yml; do yq eval --inplace ".jobs.build.strategy.matrix.go[0] = ${golang_base_version}" "$f"; done