Skip to content

Commit 30f3631

Browse files
committed
Change builder image
Use golang 1.23 from openshift builder images. Signed-off-by: Julien Ropé <[email protected]>
1 parent 7593c4d commit 30f3631

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

podvm-payload/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
## GOLANG ##
2-
FROM registry.access.redhat.com/ubi9/go-toolset:1.22.9-1739801907 as go_builder
3-
USER root
2+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.23 as go_builder
43
ARG ARCH
54
ENV ARCH=${ARCH}
65

@@ -10,6 +9,7 @@ COPY src/cloud-api-adaptor /workdir
109

1110
# binary: agent-protocol-forwarder, proccess-user-data (golang)
1211
WORKDIR /workdir
12+
ENV GOFLAGS="-tags=strictfipsruntime,aws,azure,ibmcloud,vsphere,libvirt,gcp"
1313
RUN CGO_ENABLED=1 GOOS=linux go build \
1414
-ldflags=-X=github.com/openshift/cloud-api-adaptor/cmd.VERSION=${CI_CLOUD_API_ADAPTOR_UPSTREAM_VERSION} \
1515
-ldflags=-X=github.com/openshift/cloud-api-adaptor/cmd.COMMIT=${CI_CLOUD_API_ADAPTOR_UPSTREAM_COMMIT} \

src/cloud-api-adaptor/Dockerfile.openshift

+6-8
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ ARG BUILD_TYPE=dev
1212
# binary into the container image of the target platform ($TARGETPLATFORM)
1313
# that was specified with --platform. For more details see:
1414
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
15-
FROM registry.access.redhat.com/ubi9/go-toolset:1.22.9-1739801907 AS builder-release
15+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.23 AS builder-release
16+
# openshift-golang-builder: GOFLAGS is set to "-mod" by default in our builder image.
17+
# We need to disable that to keep the build running.
18+
ENV GOFLAGS=""
1619
ARG YQ_VERSION
17-
# "USER root" is required for podman builds
18-
USER root
19-
# the build process assumes go is under "/go", so let's make sure it works
20-
RUN ln -s /opt/app-root/src/go /go
2120
RUN go install github.com/mikefarah/yq/v4@$YQ_VERSION
2221

2322
# This registering RHEL when building on an unsubscribed system
@@ -43,7 +42,6 @@ ARG RELEASE_BUILD
4342
ARG COMMIT
4443
ARG VERSION
4544
ARG TARGETARCH
46-
USER root
4745

4846
WORKDIR /work
4947
COPY cloud-api-adaptor/go.mod cloud-api-adaptor/go.sum ./cloud-api-adaptor/
@@ -59,8 +57,8 @@ COPY cloud-api-adaptor/proto ./proto
5957

6058
# Set the desired cloud providers for our downstream build (not upsream default)
6159
ENV BUILTIN_CLOUD_PROVIDERS="strictfipsruntime aws azure ibmcloud vsphere libvirt gcp"
62-
# Make sure the PATH and GOPATH are set appropriately - our builder image being different, the upstream scripts fail otherwise
63-
ENV PATH=/opt/app-root/src/go/bin:$PATH
60+
# Make sure the PATH is set appropriately - our builder image being different, the upstream scripts fail otherwise
61+
ENV PATH=$GOPATH/bin:$PATH
6462
RUN CC=gcc make ARCH=$TARGETARCH COMMIT=$COMMIT VERSION=$VERSION RELEASE_BUILD=$RELEASE_BUILD cloud-api-adaptor
6563

6664
# FROM builder-release AS iptables

src/webhook/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM registry.access.redhat.com/ubi9/go-toolset:1.22.9-1739801907 AS builder
2+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.23 AS builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests
@@ -18,7 +18,7 @@ COPY pkg/ pkg/
1818
# Build
1919
ARG TARGETARCH
2020
ENV GOFLAGS="-tags=strictfipsruntime"
21-
USER root
21+
2222
RUN CGO_ENABLED=1 GOOS=linux GOARCH=$TARGETARCH go build -mod=readonly -a -o manager main.go
2323

2424
FROM registry.access.redhat.com/ubi9/ubi-micro:latest

0 commit comments

Comments
 (0)