Skip to content

Commit

Permalink
images: Update golang base image
Browse files Browse the repository at this point in the history
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
openshift-eng/art-tools#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.
  • Loading branch information
cfergeau committed Oct 25, 2023
1 parent 008062b commit 4c0349c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion images/build-e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion images/build-integration/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion images/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>

WORKDIR $APP_ROOT/src
Expand Down
2 changes: 1 addition & 1 deletion images/openshift-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions update-go-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4c0349c

Please sign in to comment.