Skip to content

Commit 9ebf9fd

Browse files
authored
Merge pull request #21643 from medyagh/debian12_fresh
Kicbase: Switch ubuntu jammy to debian bookworm
2 parents 63d7b46 + cc42fd2 commit 9ebf9fd

File tree

8 files changed

+336
-291
lines changed

8 files changed

+336
-291
lines changed

.github/workflows/update-ubuntu-version.yml renamed to .github/workflows/update-debian-version.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "update-ubuntu-version"
1+
name: "update-debian-version"
22
on:
33
workflow_dispatch:
44
schedule:
@@ -19,35 +19,35 @@ jobs:
1919
with:
2020
go-version: ${{env.GO_VERSION}}
2121
- name: Bump Ubuntu version
22-
id: bumpUbuntu
22+
id: bumpBaseOsImage
2323
run: |
2424
echo "OLD_VERSION=$(DEP=ubuntu make get-dependency-version)" >> "$GITHUB_OUTPUT"
25-
make update-ubuntu-version
25+
make update-debian-version
2626
echo "NEW_VERSION=$(DEP=ubuntu make get-dependency-version)" >> "$GITHUB_OUTPUT"
2727
# The following is to support multiline with GITHUB_OUTPUT, see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
2828
echo "changes<<EOF" >> "$GITHUB_OUTPUT"
2929
echo "$(git status --porcelain)" >> "$GITHUB_OUTPUT"
3030
echo "EOF" >> "$GITHUB_OUTPUT"
3131
- name: Create PR
3232
id: createPR
33-
if: ${{ steps.bumpUbuntu.outputs.changes != '' }}
33+
if: ${{ steps.bumpBaseOsImage.outputs.changes != '' }}
3434
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
3535
with:
3636
token: ${{ secrets.MINIKUBE_BOT_PAT }}
37-
commit-message: 'Kicbase: Bump ubuntu:jammy from ${{ steps.bumpUbuntu.outputs.OLD_VERSION }} to ${{ steps.bumpUbuntu.outputs.NEW_VERSION }}'
37+
commit-message: 'Kicbase: Bump debian:bookworm from ${{ steps.bumpBaseOsImage.outputs.OLD_VERSION }} to ${{ steps.bumpBaseOsImage.outputs.NEW_VERSION }}'
3838
committer: minikube-bot <minikube-bot@google.com>
3939
author: minikube-bot <minikube-bot@google.com>
40-
branch: auto_bump_ubuntu_version
40+
branch: auto_bump_debian_version
4141
push-to-fork: minikube-bot/minikube
4242
base: master
4343
delete-branch: true
44-
title: 'Kicbase: Bump ubuntu:jammy from ${{ steps.bumpUbuntu.outputs.OLD_VERSION }} to ${{ steps.bumpUbuntu.outputs.NEW_VERSION }}'
44+
title: 'Kicbase: Bump debian:bookworm from ${{ steps.bumpBaseOsImage.outputs.OLD_VERSION }} to ${{ steps.bumpBaseOsImage.outputs.NEW_VERSION }}'
4545
body: |
46-
The ubuntu:jammy image released a new version
46+
The debian:bookworm image released a new version
4747
48-
This PR was auto-generated by `make update-ubuntu-version` using [update-ubuntu-version.yml](https://github.com/kubernetes/minikube/tree/master/.github/workflows/update-ubuntu-version.yml) CI Workflow.
48+
This PR was auto-generated by `make update-debian-version` using [update-debian-version.yml](https://github.com/kubernetes/minikube/tree/master/.github/workflows/update-debian-version.yml) CI Workflow.
4949
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
50-
if: ${{ steps.bumpUbuntu.outputs.changes != '' }}
50+
if: ${{ steps.bumpBaseOsImage.outputs.changes != '' }}
5151
with:
5252
github-token: ${{ secrets.MINIKUBE_BOT_PAT }}
5353
script: |

.github/workflows/update-iso-image-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
description: "Comma-separated list of make targets to run (e.g., update-buildkit-version,update-cni-plugins-version)"
88
required: true
99
# Uncomment after crictl/cri-o issue resolved: https://github.com/kubernetes/minikube/issues/18359
10-
# default: "update-buildkit-version,update-cni-plugins-version,update-containerd-version,update-cri-o-version,update-crictl-version,update-crun-version,update-docker-version,update-docker-buildx-version,update-golang-version,update-nerdctl-version,update-nerdctld-version,update-runc-version,update-ubuntu-version"
11-
default: "update-buildkit-version,update-cni-plugins-version,update-crun-version,update-docker-version,update-golang-version,update-runc-version,update-ubuntu-version"
10+
# default: "update-buildkit-version,update-cni-plugins-version,update-containerd-version,update-cri-o-version,update-crictl-version,update-crun-version,update-docker-version,update-docker-buildx-version,update-golang-version,update-nerdctl-version,update-nerdctld-version,update-runc-version,update-debian-version"
11+
default: "update-buildkit-version,update-cni-plugins-version,update-crun-version,update-docker-version,update-golang-version,update-runc-version,update-debian-version"
1212
env:
1313
GOPROXY: https://proxy.golang.org
1414
GO_VERSION: '1.24.6'

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,9 @@ update-runc-version:
11331133
update-docker-version:
11341134
cd hack && go run update/docker_version/docker_version.go
11351135

1136-
.PHONY: update-ubuntu-version
1137-
update-ubuntu-version:
1138-
cd hack && go run update/ubuntu_version/ubuntu_version.go
1136+
.PHONY: update-debian-version
1137+
update-debian-version:
1138+
cd hack && go run update/debian_version/debian_version.go
11391139

11401140
.PHONY: update-cni-plugins-version
11411141
update-cni-plugins-version:

deploy/kicbase/Dockerfile

Lines changed: 74 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
# https://systemd.io/CONTAINER_INTERFACE/
1919

2020

21-
# this ARG needs to be global to use it in `FROM` & is updated for new versions of ubuntu:jammy-*
22-
ARG UBUNTU_JAMMY_IMAGE="ubuntu:jammy-20250819"
21+
# this ARG needs to be global to use it in `FROM` & is updated for new versions of debian:bookworm-slim-*
22+
ARG KICBASE_IMAGE="debian:bookworm-20250908-slim"
2323
# multi-stage docker build so we can build auto-pause for arm64
24-
FROM golang:1.24.6 as auto-pause
24+
FROM golang:1.24.6 AS auto-pause
2525
WORKDIR /src
2626
# auto-pause depends on core minikube code so we need to pass the whole source code as the context
2727
# copy in the minimal amount of source code possible
@@ -37,12 +37,13 @@ ENV GOARCH=${TARGETARCH}
3737
ARG PREBUILT_AUTO_PAUSE
3838
RUN if [ "$PREBUILT_AUTO_PAUSE" != "true" ]; then cd ./cmd/auto-pause/ && go build -o auto-pause-${TARGETARCH}; fi
3939

40-
# start from ubuntu 22.04, this image is reasonably small as a starting point
40+
# start from debin 12, this image is reasonably small as a starting point
4141
# for a kubernetes node image, it doesn't contain much we don't need
42-
FROM ${UBUNTU_JAMMY_IMAGE} as kicbase
42+
FROM ${KICBASE_IMAGE} AS kicbase
4343

4444
ARG BUILDKIT_VERSION="v0.18.1"
45-
ARG CRIO_VERSION="1.24"
45+
ARG CRIO_VERSION="v1.34"
46+
ARG CRICTL_VERSION="v1.34.0"
4647
ARG CRI_DOCKERD_VERSION="v0.4.0"
4748
ARG CRI_DOCKERD_COMMIT="b9b889355f3002c01db294427964e454dfbc3feb"
4849
ARG CNI_PLUGINS_VERSION="v1.4.0"
@@ -140,6 +141,16 @@ RUN clean-install \
140141
# libglib2.0-0 is required for conmon, which is required for podman
141142
libglib2.0-0
142143

144+
# Add support for rsa1 in sshd
145+
# modern debian-based OSs dont support rsa1 by default, so we need to enable it to support older ssh clients
146+
# TODO: remove after https://github.com/kubernetes/minikube/issues/21543 is solved
147+
RUN cat <<EOF >> /etc/ssh/sshd_config
148+
PubkeyAcceptedAlgorithms +ssh-rsa
149+
HostkeyAlgorithms +ssh-rsa
150+
PubkeyAuthentication yes
151+
PasswordAuthentication no
152+
EOF
153+
143154
# Install nerdctl and nerdctld
144155
RUN export ARCH=$(dpkg --print-architecture) \
145156
&& if [ "$ARCH" = 'amd64' ] || [ "$ARCH" = 'arm64' ]; then \
@@ -153,10 +164,15 @@ RUN export ARCH=$(dpkg --print-architecture) \
153164
fi
154165

155166
# install docker
156-
RUN sh -c "echo 'deb https://download.docker.com/linux/ubuntu jammy stable' > /etc/apt/sources.list.d/docker.list" && \
157-
curl -L https://download.docker.com/linux/ubuntu/gpg -o docker.key && \
158-
apt-key add - < docker.key && \
159-
clean-install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
167+
## ref: https://docs.docker.com/engine/install/debian/#install-using-the-repository
168+
RUN install -m 0755 -d /etc/apt/keyrings \
169+
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
170+
&& chmod a+r /etc/apt/keyrings/docker.asc \
171+
&& echo \
172+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
173+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
174+
tee /etc/apt/sources.list.d/docker.list > /dev/null \
175+
&& clean-install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
160176

161177
# install buildkit
162178
RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/armhf/arm-v7/') \
@@ -187,30 +203,57 @@ RUN clean-install podman && \
187203
echo "d /run/podman 0770 root podman" > /etc/tmpfiles.d/podman.conf && \
188204
systemd-tmpfiles --create
189205

206+
# install crictl
207+
RUN export ARCH=$(dpkg --print-architecture) && \
208+
case "$ARCH" in \
209+
amd64) CRICTL_ARCH="amd64" ;; \
210+
arm64) CRICTL_ARCH="arm64" ;; \
211+
armhf) CRICTL_ARCH="armhf" ;; \
212+
ppc64el) CRICTL_ARCH="ppc64le" ;; \
213+
s390x) CRICTL_ARCH="s390x" ;; \
214+
*) echo "Unsupported architecture for crictl: $ARCH" && exit 1 ;; \
215+
esac && \
216+
if [ "$CRICTL_ARCH" != "armhf" ]; then \
217+
curl -fsSL --retry 5 --output /tmp/crictl.tgz "https://github.com/kubernetes-sigs/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-${CRICTL_ARCH}.tar.gz" && \
218+
tar -C /usr/local/bin -xzvf /tmp/crictl.tgz && \
219+
rm -f /tmp/crictl.tgz && \
220+
chmod +x /usr/local/bin/crictl && \
221+
if [ -f /usr/local/bin/critest ]; then chmod +x /usr/local/bin/critest; fi; \
222+
else \
223+
echo "Skipping crictl install for armhf: No asset available in v1.34.0"; \
224+
fi
190225
# install cri-o dependencies:
191226
RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/') && \
192-
sh -c "echo 'deb https://downloadcontent.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
193-
curl -LO https://downloadcontent.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_22.04/Release.key && \
194-
apt-key add - < Release.key && \
227+
mkdir -p /etc/apt/keyrings && \
228+
curl -fsSL https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_12/Release.key | \
229+
gpg --dearmor --yes -o /etc/apt/keyrings/libcontainers-archive-keyring.gpg && \
230+
sh -c "echo 'deb [signed-by=/etc/apt/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_12/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
195231
if [ "$ARCH" != "ppc64le" ]; then \
196-
clean-install catatonit conmon cri-tools crun; \
232+
clean-install catatonit crun; \
197233
else \
198-
clean-install conmon crun; \
234+
clean-install crun; \
199235
fi
200-
201236
# install containernetworking-plugins
202237
RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/armhf/arm/') && \
203238
curl -LO "https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/cni-plugins-linux-$ARCH-${CNI_PLUGINS_VERSION}.tgz" && \
204239
mkdir -p /opt/cni/bin && \
205240
tar -xf "cni-plugins-linux-$ARCH-${CNI_PLUGINS_VERSION}.tgz" -C /opt/cni/bin && \
206241
rm "cni-plugins-linux-$ARCH-${CNI_PLUGINS_VERSION}.tgz"
207242

208-
# install cri-o based on https://github.com/cri-o/cri-o/blob/release-1.24/README.md#installing-cri-o
243+
# install cri-o from the OBS repositories
209244
RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/armhf/arm-v7/') && \
210-
if [ "$ARCH" != "ppc64le" ] && [ "$ARCH" != "arm-v7" ]; then sh -c "echo 'deb https://downloadcontent.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${CRIO_VERSION}/xUbuntu_22.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:${CRIO_VERSION}.list" && \
211-
curl -LO https://downloadcontent.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${CRIO_VERSION}/xUbuntu_22.04/Release.key && \
212-
apt-key add - < Release.key && \
213-
clean-install cri-o cri-o-runc; fi
245+
if [ "$ARCH" != "ppc64le" ] && [ "$ARCH" != "arm-v7" ]; then \
246+
mkdir -p /etc/apt/sources.list.d /etc/apt/trusted.gpg.d && \
247+
echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_12/ /' \
248+
> /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && \
249+
curl -fsSL https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_12/Release.key \
250+
| gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_stable.gpg && \
251+
echo "deb http://download.opensuse.org/repositories/isv:/cri-o:/stable:/${CRIO_VERSION}:/build/deb/ /" \
252+
> "/etc/apt/sources.list.d/isv:cri-o:stable:${CRIO_VERSION}:build.list" && \
253+
curl -fsSL "https://download.opensuse.org/repositories/isv:cri-o:stable:${CRIO_VERSION}:build/deb/Release.key" \
254+
| gpg --dearmor --yes -o "/etc/apt/trusted.gpg.d/isv_cri-o_stable_${CRIO_VERSION}_build.gpg" && \
255+
clean-install cri-o; \
256+
fi
214257

215258
# install NVIDIA container toolkit
216259
RUN export ARCH=$(dpkg --print-architecture) && \
@@ -236,29 +279,30 @@ COPY deploy/kicbase/scheduled-stop/minikube-scheduled-stop /var/lib/minikube/sch
236279
COPY deploy/kicbase/scheduled-stop/minikube-scheduled-stop.service /usr/lib/systemd/system/minikube-scheduled-stop.service
237280
RUN chmod +x /var/lib/minikube/scheduled-stop/minikube-scheduled-stop
238281

239-
# disable non-docker runtimes by default
282+
# disable non-docker runtimes by default (since cri-dockerd is default in minikube)
240283
RUN systemctl disable containerd
241284
# disable crio for archs that support it
242285
RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/armhf/arm-v7/') && \
243-
if [ "$ARCH" != "ppc64le" ] && [ "$ARCH" != "arm-v7" ]; then systemctl disable crio && rm /etc/crictl.yaml; fi
286+
if [ "$ARCH" != "ppc64le" ] && [ "$ARCH" != "arm-v7" ]; then systemctl disable crio && rm -f /etc/crictl.yaml; fi
244287
# enable podman socket on archs that support it
245288
RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/') && if [ "$ARCH" != "ppc64le" ]; then systemctl enable podman.socket; fi
246289
# enable docker which is default
247290
RUN systemctl enable docker.service
248-
# making SSH work for docker container
249-
# based on https://github.com/rastasheep/ubuntu-sshd/blob/master/18.04/Dockerfile
250-
RUN mkdir /var/run/sshd
251-
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
252291
# minikube relies on /etc/hosts for control-plane discovery. This prevents nefarious DNS servers from breaking it.
253292
RUN sed -ri 's/dns files/files dns/g' /etc/nsswitch.conf
254293

255294
EXPOSE 22
256295
# create docker user for minikube ssh. to match VM using "docker" as username
257-
RUN adduser --ingroup docker --disabled-password --gecos '' docker
258-
RUN adduser docker sudo
296+
# Ensure 'docker' group exists; create a 'docker' user with a shell
297+
## ref: https://docs.docker.com/engine/install/linux-postinstall/
298+
RUN groupadd -f docker \
299+
&& useradd -m -s /bin/bash -g docker -G sudo docker
300+
# Ensure the account is usable for key-only SSH - unlock the account, and disable password
301+
RUN usermod -p '*' docker && passwd -u docker && passwd -d docker
302+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/20-passwordless-sudo \
303+
&& chmod 0440 /etc/sudoers.d/20-passwordless-sudo
259304
RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/') && if [ "$ARCH" != "ppc64le" ]; then adduser docker podman; fi
260305
RUN adduser docker buildkit
261-
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
262306
USER docker
263307
RUN mkdir /home/docker/.ssh
264308
USER root

0 commit comments

Comments
 (0)