File tree Expand file tree Collapse file tree 11 files changed +82
-20
lines changed Expand file tree Collapse file tree 11 files changed +82
-20
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ dependencies:
144
144
- path : images/build/go-runner/VERSION
145
145
146
146
- name : " registry.k8s.io/build-image/go-runner (go1.25-bookworm)"
147
- version : v2.4.0-go1.25rc2 -bookworm.0
147
+ version : v2.4.0-go1.25.1 -bookworm.0
148
148
refPaths :
149
149
- path : images/build/go-runner/variants.yaml
150
150
match : v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
@@ -195,7 +195,7 @@ dependencies:
195
195
match : " CONFIG: 'go\\ d+.\\ d+-bullseye'"
196
196
197
197
- name : " registry.k8s.io/build-image/kube-cross (v1.34-go1.25)"
198
- version : v1.34.0-go1.25rc2 -bullseye.0
198
+ version : v1.34.0-go1.25.1 -bullseye.0
199
199
refPaths :
200
200
- path : images/build/cross/variants.yaml
201
201
match : " IMAGE_VERSION: 'v((([0-9]+)\\ .([0-9]+)\\ .([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\ .[0-9a-zA-Z-]+)*))?)(?:\\ +([0-9a-zA-Z-]+(?:\\ .[0-9a-zA-Z-]+)*))?)'"
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ REVISION ?= 0
35
35
TYPE ?= default
36
36
37
37
# Build args
38
- BASEIMAGE ?= golang :$(GO_VERSION ) - $( OS_CODENAME )
38
+ BASEIMAGE ?= debian :$(OS_CODENAME ) -slim
39
39
PROTOBUF_VERSION ?= 3.19.4
40
40
41
41
IMAGE = $(REGISTRY ) /$(IMGNAME )
@@ -83,6 +83,8 @@ container: check-env init-docker-buildx
83
83
--tag $(IMAGE ) -$$ {platform## */}:latest-$(CONFIG)-$(TYPE) \
84
84
--build-arg=BASEIMAGE=$(BASEIMAGE ) \
85
85
--build-arg=PROTOBUF_VERSION=$(PROTOBUF_VERSION ) \
86
+ --build-arg=TARGETPLATFORM=$$ {platform} \
87
+ --build-arg=GO_VERSION=$(GO_VERSION ) \
86
88
--file $(TYPE ) /Dockerfile \
87
89
. ; \
88
90
done
Original file line number Diff line number Diff line change 16
16
# platform go binary for the architecture kubernetes cares about.
17
17
18
18
ARG BASEIMAGE
19
+ ARG GO_VERSION
20
+ FROM golang:${GO_VERSION}-alpine as go-source
19
21
FROM ${BASEIMAGE}
20
22
21
23
# #------------------------------------------------------------
@@ -40,6 +42,12 @@ ENV KUBE_CROSSPLATFORMS \
40
42
windows/amd64 windows/386
41
43
42
44
# #------------------------------------------------------------
45
+ COPY --from=go-source /usr/local/go /usr/local/go
46
+ ENV PATH=/usr/local/go/bin:$PATH
47
+ ENV GOROOT=/usr/local/go
48
+ ENV GOLANG_VERSION=${GO_VERSION}
49
+ ENV GOTOOLCHAIN=local
50
+ ENV GOPATH=/usr/local/go
43
51
44
52
# Pre-compile the standard go library when cross-compiling. This is much easier now when we have go1.5+
45
53
RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/' ) \
52
60
RUN apt-get -q update \
53
61
&& apt-get install -qqy \
54
62
apt-utils \
63
+ curl \
55
64
file \
65
+ git \
66
+ gnupg2 \
67
+ iproute2 \
56
68
jq \
69
+ openssh-client \
57
70
patch \
58
71
rsync \
59
72
unzip \
60
- iproute2
73
+ wget
61
74
62
75
# Use dynamic cgo linking for architectures other than amd64 for the server platforms
63
76
# To install crossbuild essential for other architectures add the following repository.
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ variants:
2
2
v1.34-go1.25-bullseye :
3
3
CONFIG : ' go1.25-bullseye'
4
4
TYPE : ' default'
5
- IMAGE_VERSION : ' v1.34.0-go1.25rc2 -bullseye.0'
5
+ IMAGE_VERSION : ' v1.34.0-go1.25.1 -bullseye.0'
6
6
KUBERNETES_VERSION : ' v1.34.0'
7
- GO_VERSION : ' 1.25rc2 '
7
+ GO_VERSION : ' 1.25.1 '
8
8
GO_MAJOR_VERSION : ' 1.25'
9
9
OS_CODENAME : ' bullseye'
10
10
REVISION : ' 0'
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- # Build the manager binary
15
+ ARG GO_VERSION
16
16
ARG DISTROLESS_IMAGE
17
17
ARG BUILDER_IMAGE
18
+
19
+ # Get Go from official Alpine image
20
+ FROM golang:${GO_VERSION}-alpine as go-source
21
+
22
+ # Build the manager binary
18
23
FROM ${BUILDER_IMAGE} as builder
19
24
WORKDIR /workspace
20
25
26
+ # Copy Go installation from official image
27
+ COPY --from=go-source /usr/local/go /usr/local/go
28
+
29
+ # Set up Go environment
30
+ ENV PATH=/usr/local/go/bin:$PATH
31
+ ENV GOROOT=/usr/local/go
32
+ ENV GOLANG_VERSION=${GO_VERSION}
33
+ ENV GOTOOLCHAIN=local
34
+ ENV GOPATH=/usr/local/go
35
+
21
36
# Copy the sources
22
37
COPY ./go-runner.go ./
23
38
COPY ./go.* ./
@@ -38,11 +53,8 @@ ENV GOPROXY="https://proxy.golang.org|direct"
38
53
39
54
# Build
40
55
ARG package=.
41
- ARG ARCH
42
56
43
57
ENV CGO_ENABLED=0
44
- ENV GOOS=linux
45
- ENV GOARCH=${ARCH}
46
58
47
59
RUN go env
48
60
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ APP_VERSION = $(shell cat VERSION)
20
20
GO_MAJOR_VERSION ?= 1.24
21
21
REVISION ?= 0
22
22
GO_VERSION ?= 1.24.6
23
- OS_CODENAME ?= bookworm
23
+ OS_CODENAME ?= bookworm-slim
24
24
25
25
# Build args
26
26
DISTROLESS_REGISTRY ?= gcr.io/distroless
27
27
DISTROLESS_IMAGE ?= static-debian12
28
- BUILDER_IMAGE ?= golang: $( GO_VERSION ) - $(OS_CODENAME )
28
+ BUILDER_IMAGE ?= debian: $(OS_CODENAME )
29
29
30
30
# Configuration
31
31
CONFIG = go$(GO_MAJOR_VERSION ) -$(OS_CODENAME )
53
53
rm go-runner
54
54
55
55
BUILD_ARGS = --build-arg=BUILDER_IMAGE=$(BUILDER_IMAGE ) \
56
- --build-arg=DISTROLESS_IMAGE=$(DISTROLESS_REGISTRY ) /$(DISTROLESS_IMAGE )
56
+ --build-arg=DISTROLESS_IMAGE=$(DISTROLESS_REGISTRY ) /$(DISTROLESS_IMAGE ) \
57
+ --build-arg=GO_VERSION=$(GO_VERSION )
Original file line number Diff line number Diff line change 1
1
variants :
2
2
go1.25-bookworm :
3
3
CONFIG : ' go1.25-bookworm'
4
- IMAGE_VERSION : ' v2.4.0-go1.25rc2 -bookworm.0'
4
+ IMAGE_VERSION : ' v2.4.0-go1.25.1 -bookworm.0'
5
5
GO_MAJOR_VERSION : ' 1.25'
6
6
OS_CODENAME : ' bookworm'
7
7
REVISION : ' 0'
8
- GO_VERSION : ' 1.25rc2 '
8
+ GO_VERSION : ' 1.25.1 '
9
9
DISTROLESS_IMAGE : ' static-debian12'
10
10
go1.24-bookworm :
11
11
CONFIG : ' go1.24-bookworm'
Original file line number Diff line number Diff line change 14
14
15
15
ARG GO_VERSION
16
16
ARG OS_CODENAME
17
- FROM golang:${GO_VERSION}-${OS_CODENAME} as builder
17
+
18
+ # Get Go from official Alpine image
19
+ FROM golang:${GO_VERSION}-alpine as go-source
20
+
21
+ FROM debian:${OS_CODENAME}-slim
22
+
23
+ # Copy Go installation from official image
24
+ COPY --from=go-source /usr/local/go /usr/local/go
25
+
26
+ # Set up Go environment
27
+ ENV PATH=/usr/local/go/bin:$PATH
28
+ ENV GOROOT=/usr/local/go
29
+ ENV GOLANG_VERSION=${GO_VERSION}
30
+ ENV GOTOOLCHAIN=local
31
+ ENV GOPATH=/usr/local/go
32
+
33
+ # Install required packages for adding Google Cloud SDK repository
34
+ RUN apt-get update && \
35
+ apt-get install -y curl gnupg
18
36
19
37
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
20
38
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
@@ -26,9 +44,11 @@ RUN apt-get update && \
26
44
apt-get install -y \
27
45
bsdmainutils \
28
46
build-essential \
47
+ git \
29
48
google-cloud-sdk \
30
49
jq \
31
50
rpmlint \
51
+ wget \
32
52
&& rm -rf /var/lib/apt/lists/*
33
53
34
54
# install goreleaser
Original file line number Diff line number Diff line change 1
1
variants :
2
2
go1.25-bookworm :
3
3
CONFIG : ' go1.25-bookworm'
4
- GO_VERSION : ' 1.25rc2 '
4
+ GO_VERSION : ' 1.25.1 '
5
5
OS_CODENAME : ' bookworm'
6
6
REVISION : ' 0'
7
7
go1.24-bookworm :
Original file line number Diff line number Diff line change @@ -17,7 +17,21 @@ ARG OS_CODENAME
17
17
18
18
# The Release Tooling can be compiled with a different version of Go than the
19
19
# the Go version used in the kubernetes/kubernetes active development branch.
20
- FROM golang:${GO_VERSION_TOOLING}-${OS_CODENAME} AS builder
20
+ FROM golang:${GO_VERSION_TOOLING}-alpine as go-source
21
+ FROM debian:${OS_CODENAME}-slim AS builder
22
+
23
+ # Install CA certificates for TLS verification
24
+ RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
25
+
26
+ # Copy Go installation from official image
27
+ COPY --from=go-source /usr/local/go /go
28
+
29
+ # Set up Go environment
30
+ ENV PATH=/go/bin:$PATH
31
+ ENV GOROOT=/go
32
+ ENV GOLANG_VERSION=${GO_VERSION_TOOLING}
33
+ ENV GOTOOLCHAIN=local
34
+ ENV GOPATH=/go
21
35
22
36
WORKDIR /go/src/k8s.io/release
23
37
You can’t perform that action at this time.
0 commit comments