File tree Expand file tree Collapse file tree 11 files changed +70
-21
lines changed Expand file tree Collapse file tree 11 files changed +70
-21
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,7 +42,9 @@ ENV KUBE_CROSSPLATFORMS \
40
42
windows/amd64 windows/386
41
43
42
44
# #------------------------------------------------------------
43
-
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
44
48
# Pre-compile the standard go library when cross-compiling. This is much easier now when we have go1.5+
45
49
RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/' ) \
46
50
&& if [ ${targetArch} = "amd64" ]; then \
52
56
RUN apt-get -q update \
53
57
&& apt-get install -qqy \
54
58
apt-utils \
59
+ curl \
55
60
file \
61
+ git \
62
+ gnupg2 \
63
+ iproute2 \
56
64
jq \
65
+ openssh-client \
57
66
patch \
58
67
rsync \
59
68
unzip \
60
- iproute2
69
+ wget
61
70
62
71
# Use dynamic cgo linking for architectures other than amd64 for the server platforms
63
72
# 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
+
21
33
# Copy the sources
22
34
COPY ./go-runner.go ./
23
35
COPY ./go.* ./
@@ -38,11 +50,8 @@ ENV GOPROXY="https://proxy.golang.org|direct"
38
50
39
51
# Build
40
52
ARG package=.
41
- ARG ARCH
42
53
43
54
ENV CGO_ENABLED=0
44
- ENV GOOS=linux
45
- ENV GOARCH=${ARCH}
46
55
47
56
RUN go env
48
57
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
+
30
+ # Install required packages for adding Google Cloud SDK repository
31
+ RUN apt-get update && \
32
+ apt-get install -y curl gnupg
18
33
19
34
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
20
35
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
@@ -26,9 +41,11 @@ RUN apt-get update && \
26
41
apt-get install -y \
27
42
bsdmainutils \
28
43
build-essential \
44
+ git \
29
45
google-cloud-sdk \
30
46
jq \
31
47
rpmlint \
48
+ wget \
32
49
&& rm -rf /var/lib/apt/lists/*
33
50
34
51
# 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,18 @@ 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
21
32
22
33
WORKDIR /go/src/k8s.io/release
23
34
You can’t perform that action at this time.
0 commit comments