Skip to content

Commit 421639c

Browse files
committed
Upgrade Go lang, python and base images
chore: Update go lang to 1.22 since go-toolset image has bad grade. Update python from 3.8 to 3.11 and use alternatives to set the right python binary. Update the base images from UBI8 to UBI9. Signed-off-by: Spolti <[email protected]>
1 parent aecee27 commit 421639c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

Dockerfile

+9-8
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,29 @@
1515
###############################################################################
1616
# Stage 1: Create the developer image for the BUILDPLATFORM only
1717
###############################################################################
18-
ARG GOLANG_VERSION=1.21
19-
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:$GOLANG_VERSION AS develop
18+
ARG GOLANG_VERSION=1.22
19+
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/go-toolset:$GOLANG_VERSION AS develop
2020

2121
ARG PROTOC_VERSION=21.12
2222

2323
USER root
2424
ENV HOME=/root
2525

2626
# Install build and dev tools
27-
# NOTE: Require python38 to install pre-commit
27+
# python is required for pre-commit
2828
RUN --mount=type=cache,target=/root/.cache/dnf:rw \
2929
dnf install --setopt=cachedir=/root/.cache/dnf -y --nodocs \
3030
nodejs \
31-
python38 \
32-
&& ln -sf /usr/bin/python3 /usr/bin/python \
33-
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
31+
python3.11 \
32+
python3.11-pip \
33+
&& alternatives --install /usr/bin/python python /usr/bin/python3.11 1 \
34+
&& alternatives --install /usr/bin/pip pip /usr/bin/pip3.11 1 \
3435
&& true
3536

3637
# Install pre-commit
3738
ENV PIP_CACHE_DIR=/root/.cache/pip
3839
RUN --mount=type=cache,target=/root/.cache/pip \
39-
pip install pre-commit
40+
/usr/bin/pip install pre-commit
4041

4142
# When using the BuildKit backend, Docker predefines a set of ARG variables with
4243
# information on the platform of the node performing the build (build platform)
@@ -133,7 +134,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
133134
###############################################################################
134135
# Stage 3: Copy binaries only to create the smallest final runtime image
135136
###############################################################################
136-
FROM registry.access.redhat.com/ubi8/ubi-micro:latest as runtime
137+
FROM registry.access.redhat.com/ubi9/ubi-micro:9.5 as runtime
137138

138139
ARG USER=2000
139140

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kserve/rest-proxy
22

3-
go 1.21
3+
go 1.22.9
44

55
require (
66
github.com/google/go-cmp v0.6.0

proxy/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func run() error {
9090
skipVerifyBool := false
9191
skipVerify, ok := os.LookupEnv(restProxySkipVerifyEnvVar)
9292
if ok {
93-
err := *new(error)
93+
var err error
9494
skipVerifyBool, err = strconv.ParseBool(skipVerify)
9595
if err != nil {
9696
logger.Error(err, "Failed to parse %s=%s to bool", restProxySkipVerifyEnvVar, skipVerify)

0 commit comments

Comments
 (0)