Skip to content

Commit

Permalink
Merge pull request #94 from razo7/set-go-version
Browse files Browse the repository at this point in the history
Set Go version in less places
  • Loading branch information
openshift-ci[bot] authored Oct 4, 2023
2 parents b45101c + 01904d4 commit eecff9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build_root_image:
namespace: openshift
name: release
tag: rhel-8-release-golang-1.20-openshift-4.14
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
FROM quay.io/centos/centos:stream9 AS builder
RUN dnf install git golang -y

# Ensurec orrect Go version
ENV GO_VERSION=1.20
RUN go install golang.org/dl/go${GO_VERSION}@latest
RUN ~/go/bin/go${GO_VERSION} download
RUN /bin/cp -f ~/go/bin/go${GO_VERSION} /usr/bin/go
RUN go version

WORKDIR /workspace

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum

# Ensure correct Go version
RUN export GO_VERSION=$(grep -E "go [[:digit:]]\.[[:digit:]][[:digit:]]" go.mod | awk '{print $2}') && \
go install golang.org/dl/go${GO_VERSION}@latest && \
~/go/bin/go${GO_VERSION} download && \
/bin/cp -f ~/go/bin/go${GO_VERSION} /usr/bin/go && \
go version

# Copy the go source
COPY api/ api/
COPY controllers/ controllers/
Expand Down

0 comments on commit eecff9e

Please sign in to comment.