Skip to content

Commit 6291641

Browse files
authored
feat: Add support for building Debian 12 Bookworm repository iso (#2663)
* feat: Add support for building Debian 12 Bookworm repository iso * readme, add Debian 12 Bookworm to the supported list
1 parent f56a000 commit 6291641

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

.github/workflows/gen-repository-iso.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
dockerfile: dockerfile.debian10
2121
- name: debian11-debs
2222
dockerfile: dockerfile.debian11
23+
- name: debian12-debs
24+
dockerfile: dockerfile.debian12
2325
- name: ubuntu-18.04-debs
2426
dockerfile: dockerfile.ubuntu1804
2527
- name: ubuntu-20.04-debs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Use KubeKey in the following three scenarios.
2525
### Linux Distributions
2626

2727
* **Ubuntu** *16.04, 18.04, 20.04, 22.04*
28-
* **Debian** *Bullseye, Buster, Stretch*
28+
* **Debian** *Bookworm, Bullseye, Buster, Stretch*
2929
* **CentOS/RHEL** *7*
3030
* **AlmaLinux** *9.0*
3131
* **SUSE Linux Enterprise Server** *15*

README_zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ KubeKey是一个开源的轻量级工具,用于部署Kubernetes集群。它提
3030
### Linux 发行版
3131

3232
* **Ubuntu** *16.04, 18.04, 20.04, 22.04*
33-
* **Debian** *Bullseye, Buster, Stretch*
33+
* **Debian** *Bookworm, Bullseye, Buster, Stretch*
3434
* **CentOS/RHEL** *7*
3535
* **AlmaLinux** *9.0*
3636
* **SUSE Linux Enterprise Server** *15*
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM debian:12.11 as debian12
2+
ARG TARGETARCH
3+
ARG OS_RELEASE=bookworm
4+
ARG OS_VERSION=12
5+
ARG DIR=debian-12-${TARGETARCH}-debs
6+
ARG PKGS=.common[],.debs[],.debian[],.debian12[]
7+
ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage dirmngr"
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
# dump system package list
11+
RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list
12+
RUN ARCH=$(dpkg --print-architecture) \
13+
&& apt update -qq \
14+
&& apt install -y --no-install-recommends $BUILD_TOOLS \
15+
&& if [ "$TARGETARCH" = "amd64" ]; then \
16+
curl -fsSL https://download.gluster.org/pub/gluster/glusterfs/10/rsa.pub | apt-key add - ; \
17+
echo deb https://download.gluster.org/pub/gluster/glusterfs/10/LATEST/Debian/${OS_VERSION}/amd64/apt ${OS_RELEASE} main > /etc/apt/sources.list.d/gluster.list ; \
18+
fi \
19+
&& apt update -qq \
20+
&& apt upgrade -y -qq
21+
22+
WORKDIR /package
23+
COPY packages.yaml .
24+
25+
COPY --from=mikefarah/yq:4.46.1 /usr/bin/yq /usr/bin/yq
26+
RUN yq eval "${PKGS}" packages.yaml >> packages.list \
27+
&& sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls
28+
29+
RUN cat packages.urls
30+
31+
RUN mkdir -p ${DIR} \
32+
&& wget -q -x -P ${DIR} -i packages.urls \
33+
&& cd ${DIR} \
34+
&& dpkg-scanpackages ./ /dev/null | gzip -9c > ./Packages.gz
35+
36+
RUN genisoimage -r -o ${DIR}.iso ${DIR}
37+
38+
FROM scratch
39+
COPY --from=debian12 /package/*.iso /

hack/gen-repository-iso/packages.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ debian10: []
5151

5252
debian11: []
5353

54+
debian12: []
55+
5456
ubuntu: []
5557

5658
ubuntu1804: []

0 commit comments

Comments
 (0)