Skip to content

Commit c654b13

Browse files
authored
[RHOAIENG-7286] - update GoLang and ubi on Dockerfile.develop.ci (#321)
* [RHOAIENG-7286] - update GoLang and ubi on Dockerfile.develop.ci Signed-off-by: Spolti <[email protected]> * update k8s version Signed-off-by: Spolti <[email protected]> * update Signed-off-by: Spolti <[email protected]> --------- Signed-off-by: Spolti <[email protected]>
1 parent c1a93c4 commit c654b13

File tree

2 files changed

+10
-52
lines changed

2 files changed

+10
-52
lines changed

Diff for: Dockerfile.develop.ci

+8-50
Original file line numberDiff line numberDiff line change
@@ -15,52 +15,9 @@
1515
###############################################################################
1616
# Create the develop, test, and build environment
1717
###############################################################################
18+
ARG GOLANG_VERSION=1.22
19+
FROM registry.access.redhat.com/ubi9/go-toolset:$GOLANG_VERSION
1820

19-
# TODO: replace the "go_toolset" build stage once ubi8/go-toolset:1.21 is available
20-
# the go-toolset 1.21 is based on ubi9, we need to update it in the base image as well.
21-
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as go-toolset
22-
23-
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
24-
# We need TARGETOS and TARGETARCH (not BUILDOS and BUILDARCH) since the developer
25-
# image should be built for the OS of the developer using it (this is not a "builder image")
26-
ARG TARGETOS
27-
ARG TARGETARCH
28-
29-
ARG GOLANG_VERSION=1.21.6
30-
31-
USER root
32-
33-
ENV HOME=/root \
34-
PATH=/usr/local/go/bin:$PATH:
35-
36-
WORKDIR /workspace
37-
38-
# install necessary tools that are included in the ubi/go-toolset image that we are temporarily replacing
39-
RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
40-
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install \
41-
diffutils \
42-
gcc-c++ \
43-
make \
44-
wget \
45-
tar \
46-
git \
47-
which \
48-
&& microdnf update --nodocs \
49-
&& true
50-
51-
# install go
52-
RUN true \
53-
&& wget -qO go.tgz "https://golang.org/dl/go${GOLANG_VERSION}.${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" \
54-
&& tar -C /usr/local -xzf go.tgz \
55-
&& go version \
56-
&& rm go.tgz \
57-
&& true
58-
59-
####################################################################################
60-
# TODO: replace "go-toolset" build stage with ubi/go-toolset:1.21 once available #
61-
# and swap `microdnf` commands for `dnf` #
62-
####################################################################################
63-
FROM go-toolset
6421

6522
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
6623
# don't provide "default" values (e.g. 'ARG TARGETARCH=amd64') for non-buildx environments,
@@ -81,14 +38,15 @@ ENV HOME=/go
8138
WORKDIR /go/src/github.com/opendatahub-io/modelmesh-serving/
8239

8340
# Install build and dev tools
84-
# NOTE: Require python38 to install pre-commit
41+
# NOTE: Require python3 to install pre-commit
8542
RUN --mount=type=cache,target=/root/.cache/dnf:rw \
8643
dnf install --setopt=cachedir=/root/.cache/dnf -y --nodocs \
8744
nodejs \
8845
jq \
89-
python38 \
90-
&& ln -sf /usr/bin/python3 /usr/bin/python \
91-
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
46+
python3.11 \
47+
python3.11-pip \
48+
&& alternatives --install /usr/bin/unversioned-python python /usr/bin/python3.11 1 \
49+
&& alternatives --install /usr/bin/pip pip /usr/bin/pip3.11 1 \
9250
&& true
9351

9452
# Install pre-commit
@@ -161,7 +119,7 @@ RUN true \
161119
# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA)
162120
RUN true \
163121
&& go install sigs.k8s.io/controller-runtime/tools/[email protected] \
164-
&& setup-envtest use 1.23 \
122+
&& setup-envtest use 1.26 \
165123
&& true
166124

167125
# For GitHub Action 'lint', work around error "detected dubious ownership in repository at '/workspace'"

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ CONTROLLER_GEN_VERSION ?= "v0.11.4"
3535
# https://github.com/kubernetes-sigs/controller-runtime/tree/main/tools/setup-envtest
3636
# install with `go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest`
3737
# find available versions by running `setup-envtest list`
38-
KUBERNETES_VERSION ?= 1.23
38+
KUBERNETES_VERSION ?= 1.26
3939

4040
CRD_OPTIONS ?= "crd:maxDescLen=0"
4141

@@ -178,7 +178,7 @@ develop: build.develop
178178

179179
.PHONY: run
180180
## Run make target inside developer container (e.g. `make run fmt`)
181-
run: build.develop
181+
run:
182182
./scripts/develop.sh make $(RUN_ARGS)
183183

184184
.PHONY: push

0 commit comments

Comments
 (0)