Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ dependencies:
- path: images/build/go-runner/VERSION

- name: "registry.k8s.io/build-image/go-runner (go1.25-bookworm)"
version: v2.4.0-go1.25rc2-bookworm.0
version: v2.4.0-go1.25.1-bookworm.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dims the image changes from this file needs to be promoted, do you want to take care of that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saschagrunert yes of course

refPaths:
- path: images/build/go-runner/variants.yaml
match: v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
Expand Down Expand Up @@ -195,7 +195,7 @@ dependencies:
match: "CONFIG: 'go\\d+.\\d+-bullseye'"

- name: "registry.k8s.io/build-image/kube-cross (v1.34-go1.25)"
version: v1.34.0-go1.25rc2-bullseye.0
version: v1.34.0-go1.25.1-bullseye.0
refPaths:
- path: images/build/cross/variants.yaml
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-]+)*))?)'"
Expand Down
4 changes: 3 additions & 1 deletion images/build/cross/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ REVISION ?= 0
TYPE ?= default

# Build args
BASEIMAGE ?= golang:$(GO_VERSION)-$(OS_CODENAME)
BASEIMAGE ?= debian:$(OS_CODENAME)-slim
PROTOBUF_VERSION ?= 3.19.4

IMAGE = $(REGISTRY)/$(IMGNAME)
Expand Down Expand Up @@ -83,6 +83,8 @@ container: check-env init-docker-buildx
--tag $(IMAGE)-$${platform##*/}:latest-$(CONFIG)-$(TYPE) \
--build-arg=BASEIMAGE=$(BASEIMAGE) \
--build-arg=PROTOBUF_VERSION=$(PROTOBUF_VERSION) \
--build-arg=TARGETPLATFORM=$${platform} \
--build-arg=GO_VERSION=$(GO_VERSION) \
--file $(TYPE)/Dockerfile \
.; \
done
Expand Down
15 changes: 14 additions & 1 deletion images/build/cross/default/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# platform go binary for the architecture kubernetes cares about.

ARG BASEIMAGE
ARG GO_VERSION
FROM golang:${GO_VERSION}-alpine as go-source
FROM ${BASEIMAGE}

##------------------------------------------------------------
Expand All @@ -40,6 +42,12 @@ ENV KUBE_CROSSPLATFORMS \
windows/amd64 windows/386

##------------------------------------------------------------
COPY --from=go-source /usr/local/go /usr/local/go
ENV PATH=/usr/local/go/bin:$PATH
ENV GOROOT=/usr/local/go
ENV GOLANG_VERSION=${GO_VERSION}
ENV GOTOOLCHAIN=local
ENV GOPATH=/usr/local/go

# Pre-compile the standard go library when cross-compiling. This is much easier now when we have go1.5+
RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') \
Expand All @@ -52,12 +60,17 @@ fi
RUN apt-get -q update \
&& apt-get install -qqy \
apt-utils \
curl \
file \
git \
gnupg2 \
iproute2 \
jq \
openssh-client \
patch \
rsync \
unzip \
iproute2
wget

# Use dynamic cgo linking for architectures other than amd64 for the server platforms
# To install crossbuild essential for other architectures add the following repository.
Expand Down
4 changes: 2 additions & 2 deletions images/build/cross/variants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ variants:
v1.34-go1.25-bullseye:
CONFIG: 'go1.25-bullseye'
TYPE: 'default'
IMAGE_VERSION: 'v1.34.0-go1.25rc2-bullseye.0'
IMAGE_VERSION: 'v1.34.0-go1.25.1-bullseye.0'
KUBERNETES_VERSION: 'v1.34.0'
GO_VERSION: '1.25rc2'
GO_VERSION: '1.25.1'
GO_MAJOR_VERSION: '1.25'
OS_CODENAME: 'bullseye'
REVISION: '0'
Expand Down
20 changes: 16 additions & 4 deletions images/build/go-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Build the manager binary
ARG GO_VERSION
ARG DISTROLESS_IMAGE
ARG BUILDER_IMAGE

# Get Go from official Alpine image
FROM golang:${GO_VERSION}-alpine as go-source

# Build the manager binary
FROM ${BUILDER_IMAGE} as builder
WORKDIR /workspace

# Copy Go installation from official image
COPY --from=go-source /usr/local/go /usr/local/go

# Set up Go environment
ENV PATH=/usr/local/go/bin:$PATH
ENV GOROOT=/usr/local/go
ENV GOLANG_VERSION=${GO_VERSION}
ENV GOTOOLCHAIN=local
ENV GOPATH=/usr/local/go

# Copy the sources
COPY ./go-runner.go ./
COPY ./go.* ./
Expand All @@ -38,11 +53,8 @@ ENV GOPROXY="https://proxy.golang.org|direct"

# Build
ARG package=.
ARG ARCH

ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=${ARCH}

RUN go env

Expand Down
7 changes: 4 additions & 3 deletions images/build/go-runner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ APP_VERSION = $(shell cat VERSION)
GO_MAJOR_VERSION ?= 1.24
REVISION ?= 0
GO_VERSION ?= 1.24.6
OS_CODENAME ?= bookworm
OS_CODENAME ?= bookworm-slim

# Build args
DISTROLESS_REGISTRY ?= gcr.io/distroless
DISTROLESS_IMAGE ?= static-debian12
BUILDER_IMAGE ?= golang:$(GO_VERSION)-$(OS_CODENAME)
BUILDER_IMAGE ?= debian:$(OS_CODENAME)

# Configuration
CONFIG = go$(GO_MAJOR_VERSION)-$(OS_CODENAME)
Expand Down Expand Up @@ -53,4 +53,5 @@ clean:
rm go-runner

BUILD_ARGS = --build-arg=BUILDER_IMAGE=$(BUILDER_IMAGE) \
--build-arg=DISTROLESS_IMAGE=$(DISTROLESS_REGISTRY)/$(DISTROLESS_IMAGE)
--build-arg=DISTROLESS_IMAGE=$(DISTROLESS_REGISTRY)/$(DISTROLESS_IMAGE) \
--build-arg=GO_VERSION=$(GO_VERSION)
4 changes: 2 additions & 2 deletions images/build/go-runner/variants.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
variants:
go1.25-bookworm:
CONFIG: 'go1.25-bookworm'
IMAGE_VERSION: 'v2.4.0-go1.25rc2-bookworm.0'
IMAGE_VERSION: 'v2.4.0-go1.25.1-bookworm.0'
GO_MAJOR_VERSION: '1.25'
OS_CODENAME: 'bookworm'
REVISION: '0'
GO_VERSION: '1.25rc2'
GO_VERSION: '1.25.1'
DISTROLESS_IMAGE: 'static-debian12'
go1.24-bookworm:
CONFIG: 'go1.24-bookworm'
Expand Down
22 changes: 21 additions & 1 deletion images/releng/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,25 @@

ARG GO_VERSION
ARG OS_CODENAME
FROM golang:${GO_VERSION}-${OS_CODENAME} as builder

# Get Go from official Alpine image
FROM golang:${GO_VERSION}-alpine as go-source

FROM debian:${OS_CODENAME}-slim

# Copy Go installation from official image
COPY --from=go-source /usr/local/go /usr/local/go

# Set up Go environment
ENV PATH=/usr/local/go/bin:$PATH
ENV GOROOT=/usr/local/go
ENV GOLANG_VERSION=${GO_VERSION}
ENV GOTOOLCHAIN=local
ENV GOPATH=/usr/local/go

# Install required packages for adding Google Cloud SDK repository
RUN apt-get update && \
apt-get install -y curl gnupg

RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
Expand All @@ -26,9 +44,11 @@ RUN apt-get update && \
apt-get install -y \
bsdmainutils \
build-essential \
git \
google-cloud-sdk \
jq \
rpmlint \
wget \
&& rm -rf /var/lib/apt/lists/*

# install goreleaser
Expand Down
2 changes: 1 addition & 1 deletion images/releng/ci/variants.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variants:
go1.25-bookworm:
CONFIG: 'go1.25-bookworm'
GO_VERSION: '1.25rc2'
GO_VERSION: '1.25.1'
OS_CODENAME: 'bookworm'
REVISION: '0'
go1.24-bookworm:
Expand Down
16 changes: 15 additions & 1 deletion images/releng/k8s-ci-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,21 @@ ARG OS_CODENAME

# The Release Tooling can be compiled with a different version of Go than the
# the Go version used in the kubernetes/kubernetes active development branch.
FROM golang:${GO_VERSION_TOOLING}-${OS_CODENAME} AS builder
FROM golang:${GO_VERSION_TOOLING}-alpine as go-source
FROM debian:${OS_CODENAME}-slim AS builder

# Install CA certificates for TLS verification
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*

# Copy Go installation from official image
COPY --from=go-source /usr/local/go /go

# Set up Go environment
ENV PATH=/go/bin:$PATH
ENV GOROOT=/go
ENV GOLANG_VERSION=${GO_VERSION_TOOLING}
ENV GOTOOLCHAIN=local
ENV GOPATH=/go

WORKDIR /go/src/k8s.io/release

Expand Down
4 changes: 2 additions & 2 deletions images/releng/k8s-ci-builder/variants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ variants:
OS_CODENAME: 'bullseye'
next:
CONFIG: next
GO_VERSION: '1.25rc2'
GO_VERSION_TOOLING: '1.24.6'
GO_VERSION: '1.25.1'
GO_VERSION_TOOLING: '1.25.1'
OS_CODENAME: 'bookworm'
'1.34':
CONFIG: '1.34'
Expand Down