11FROM quay.io/konflux-ci/yq:latest AS yq
2- FROM brew. registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.23 AS builder
2+ FROM registry.redhat.io/ubi9:9.6-1751445649 AS builder
33
44ARG GOCILINT_VERSION="2.0.2"
55ARG GOCILINT_SHA256SUM="89cc8a7810dc63b9a37900da03e37c3601caf46d42265d774e0f1a5d883d53e2"
@@ -19,8 +19,12 @@ RUN curl -L -o gh.tar.gz ${GH_LOCATION} && \
1919 tar xzf gh.tar.gz gh_${GH_VERSION}_linux_amd64/bin/gh && \
2020 mv gh_${GH_VERSION}_linux_amd64/bin/gh /usr/local/bin
2121
22- FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.23
23- ENV GOFLAGS="-mod=mod"
22+ FROM registry.redhat.io/ubi9:9.6-1751445649
23+
24+ RUN dnf -y install openssh-clients jq skopeo python3-pyyaml git go-toolset rsync && \
25+ dnf clean all && \
26+ dnf -y autoremove && \
27+ rm -rf /var/cache/dnf
2428
2529ARG KUSTOMIZE_VERSION="v5.6.0" \
2630 CONTROLLER_GEN_VERSION="v0.16.4" \
@@ -29,6 +33,11 @@ ARG KUSTOMIZE_VERSION="v5.6.0" \
2933 GOVULNCHECK_VERSION="v1.1.4" \
3034 MOCKGEN_VERSION="v0.4.0"
3135
36+ # Set GOPATH to a standard location and add it to PATH
37+ ENV GOPATH=/go
38+ ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
39+ ENV GOFLAGS="-mod=mod"
40+
3241RUN go install sigs.k8s.io/kustomize/kustomize/v5@${KUSTOMIZE_VERSION} && \
3342 go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION} && \
3443 go install k8s.io/code-generator/cmd/openapi-gen@${OPENAPI_GEN_VERSION} && \
@@ -42,20 +51,13 @@ RUN go install sigs.k8s.io/kustomize/kustomize/v5@${KUSTOMIZE_VERSION} && \
4251# which is what consumes this image in CI.
4352# Here we make group permissions match user permissions, since the CI
4453# non-root user's gid is 0.
45- SHELL ["/bin/bash" , "-c" ]
4654RUN for bit in r x w; do find $(go env GOPATH) -perm -u+${bit} -a ! -perm -g+${bit} -exec chmod g+${bit} '{}' +; done
4755
4856COPY --from=builder /usr/local/bin/golangci-lint /usr/local/bin
4957COPY --from=builder /usr/local/bin/gh /usr/local/bin
5058COPY --from=yq /usr/bin/yq /usr/bin/yq
5159
52- RUN dnf -y install openssh-clients jq skopeo python3-pyyaml && \
53- dnf clean all && \
54- dnf -y autoremove && \
55- rm -rf /var/cach/dnf
56-
5760COPY LICENSE .
58- ENV PATH=$PATH:/go/bin
5961
6062# In CI, jobs run in this container with a really high UID generated by OCP. This user does
6163# not exist, and therefore $HOME defaults to `/` which leads to cache issues with things like `go`.
0 commit comments