From 563c2907eb59092a3bf1463ce8470eefd2399e0f Mon Sep 17 00:00:00 2001 From: zuoxuesong-worker Date: Wed, 17 Dec 2025 17:09:03 +0800 Subject: [PATCH] add kylin-v10-sp3-2403 (#2897) * add kylin-v10-sp3-2403 Signed-off-by: xuesongzuo@yunify.com * Update gen-repository-iso.yaml Signed-off-by: xuesongzuo@yunify.com * Update gen-repository-iso.yaml Signed-off-by: redscholar Signed-off-by: xuesongzuo@yunify.com Signed-off-by: redscholar Signed-off-by: xuesongzuo@yunify.com * feat: add kylin v10-sp1/sp2 (#2861) * feat: add kylin v10-sp1/sp2 Signed-off-by: xuesongzuo@yunify.com feat: add kylin v10-sp1/sp2 Signed-off-by: xuesongzuo@yunify.com feat: add kylin v10-sp1/sp2 Signed-off-by: xuesongzuo@yunify.com * feat: add kylin v10-sp1/sp2 Signed-off-by: xuesongzuo@yunify.com feat: add kylin v10-sp1/sp2 Signed-off-by: xuesongzuo@yunify.com feat: add kylin v10-sp1/sp2 Signed-off-by: xuesongzuo@yunify.com feat: add kylin v10-sp1/sp2 Signed-off-by: xuesongzuo@yunify.com --------- Signed-off-by: xuesongzuo@yunify.com * add kylin-v10-sp3-2403 Signed-off-by: xuesongzuo@yunify.com * add kylin-v10-sp3-2403 (#2896) add kylin-v10-sp3-2403 Signed-off-by: xuesongzuo@yunify.com --------- Signed-off-by: xuesongzuo@yunify.com Signed-off-by: redscholar Co-authored-by: liujian --- .github/workflows/gen-repository-iso.yaml | 46 +++++++--- .../roles/native/repository/tasks/main.yaml | 2 + .../gen-repository-iso/dockerfile.almalinux90 | 2 +- hack/gen-repository-iso/dockerfile.centos7 | 45 +++++++--- hack/gen-repository-iso/dockerfile.centos8 | 52 +++++++++++ hack/gen-repository-iso/dockerfile.debian10 | 25 +++--- hack/gen-repository-iso/dockerfile.debian11 | 2 +- .../gen-repository-iso/dockerfile.kylinv10sp1 | 44 ++++++++++ .../gen-repository-iso/dockerfile.kylinv10sp2 | 44 ++++++++++ .../gen-repository-iso/dockerfile.kylinv10sp3 | 44 ++++++++++ .../dockerfile.kylinv10sp3-2403 | 44 ++++++++++ hack/gen-repository-iso/dockerfile.ubuntu1604 | 8 +- hack/gen-repository-iso/dockerfile.ubuntu1804 | 25 ++++-- hack/gen-repository-iso/dockerfile.ubuntu2004 | 20 ++--- hack/gen-repository-iso/dockerfile.ubuntu2204 | 8 +- hack/gen-repository-iso/dockerfile.ubuntu2404 | 9 +- hack/gen-repository-iso/packages.yaml | 87 ++++--------------- 17 files changed, 353 insertions(+), 154 deletions(-) create mode 100644 hack/gen-repository-iso/dockerfile.centos8 create mode 100644 hack/gen-repository-iso/dockerfile.kylinv10sp1 create mode 100644 hack/gen-repository-iso/dockerfile.kylinv10sp2 create mode 100644 hack/gen-repository-iso/dockerfile.kylinv10sp3 create mode 100644 hack/gen-repository-iso/dockerfile.kylinv10sp3-2403 diff --git a/.github/workflows/gen-repository-iso.yaml b/.github/workflows/gen-repository-iso.yaml index 3fc6c3a5..8f376e52 100644 --- a/.github/workflows/gen-repository-iso.yaml +++ b/.github/workflows/gen-repository-iso.yaml @@ -16,18 +16,28 @@ jobs: include: - name: almalinux-9.0-rpms dockerfile: dockerfile.almalinux90 - - name: debian10-debs + - name: centos-8-rpms + dockerfile: dockerfile.centos8 + - name: debian-10-debs dockerfile: dockerfile.debian10 - - name: debian11-debs + - name: debian-11-debs dockerfile: dockerfile.debian11 - - name: debian12-debs - dockerfile: dockerfile.debian12 + - name: kylin-v10SP3-2403-rpms + dockerfile: dockerfile.kylinv10sp3-2403 + - name: kylin-v10SP3-rpms + dockerfile: dockerfile.kylinv10sp3 + - name: kylin-v10SP2-rpms + dockerfile: dockerfile.kylinv10sp2 + - name: kylin-v10SP1-rpms + dockerfile: dockerfile.kylinv10sp1 - name: ubuntu-18.04-debs dockerfile: dockerfile.ubuntu1804 - name: ubuntu-20.04-debs dockerfile: dockerfile.ubuntu2004 - name: ubuntu-22.04-debs dockerfile: dockerfile.ubuntu2204 + - name: ubuntu-24.04-debs + dockerfile: dockerfile.ubuntu2404 steps: - name: Checkout uses: actions/checkout@v4 @@ -53,27 +63,35 @@ jobs: mv ./output/linux_arm64/*.iso ${{ matrix.name }}-arm64.iso sha256sum *.iso > ${{ matrix.name }}.iso.sha256sum.txt - - name: Wait for release workflow to finish - uses: lewagon/wait-on-check-action@v1.3.4 - with: - ref: ${{ github.ref }} - check-name: 'create draft release' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - allowed-conclusions: success - - name: Release and upload packages if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - draft: true files: | ${{ matrix.name }}.iso.sha256sum.txt ${{ matrix.name }}-amd64.iso ${{ matrix.name }}-arm64.iso + - name: Synchronize artifacts to OSS + run: | + + rm -rf qsctl_v2.4.3_linux_amd64.tar.gz + wget https://attack-on-titan.gd2.qingstor.com/qsctl/v2.4.3/qsctl_v2.4.3_linux_amd64.tar.gz + tar -zxvf qsctl_v2.4.3_linux_amd64.tar.gz + rm -rf qsctl_v2.4.3_linux_amd64.tar.gz + mv qsctl_v2.4.3_linux_amd64 /usr/local/bin/qsctl + echo "access_key_id: ${{secrets.KS_QSCTL_ACCESS_KEY_ID}}" > qsctl-config.yaml + echo "secret_access_key: ${{ secrets.KS_QSCTL_SECRET_ACCESS_KEY }}" >> qsctl-config.yaml + + qsctl -c qsctl-config.yaml cp ${{ matrix.name }}.iso.sha256sum.txt qs://kubekey/kubesphere/kubekey/releases/download/iso-latest/${{ steps.prepare.outputs.version }}/${{ matrix.name }}.iso.sha256sum.txt + qsctl -c qsctl-config.yaml cp ${{ matrix.name }}-amd64.iso qs://kubekey/kubesphere/kubekey/releases/download/iso-latest/${{ steps.prepare.outputs.version }}/${{ matrix.name }}-amd64.iso + qsctl -c qsctl-config.yaml cp ${{ matrix.name }}-arm64.iso qs://kubekey/kubesphere/kubekey/releases/download/iso-latest/${{ steps.prepare.outputs.version }}/${{ matrix.name }}-arm64.iso + + rm -rf qsctl-config.yaml + + build-harbor: runs-on: ubuntu-latest if: github.repository == 'kubesphere/kubekey' diff --git a/builtin/core/roles/native/repository/tasks/main.yaml b/builtin/core/roles/native/repository/tasks/main.yaml index bd1125f8..9266bce6 100644 --- a/builtin/core/roles/native/repository/tasks/main.yaml +++ b/builtin/core/roles/native/repository/tasks/main.yaml @@ -14,6 +14,8 @@ SP2 {{- else if .os.release.VERSION | contains "Lance" }} SP3 + {{- else if .os.release.VERSION | contains "Halberd" }} + SP3-2403 {{- end -}} when: .os.release.ID | unquote | eq "kylin" diff --git a/hack/gen-repository-iso/dockerfile.almalinux90 b/hack/gen-repository-iso/dockerfile.almalinux90 index a90c8b70..8c06bd80 100644 --- a/hack/gen-repository-iso/dockerfile.almalinux90 +++ b/hack/gen-repository-iso/dockerfile.almalinux90 @@ -2,7 +2,7 @@ FROM almalinux:9.0 as almalinux90 ARG TARGETARCH ARG BUILD_TOOLS="dnf-plugins-core createrepo mkisofs epel-release" ARG DIR=almalinux-9.0-${TARGETARCH}-rpms -ARG PKGS=.common[],.rpms[],.almalinux[],.almalinux90[] +ARG PKGS=".common[],.rpms[]" RUN dnf install -q -y ${BUILD_TOOLS} \ && dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \ diff --git a/hack/gen-repository-iso/dockerfile.centos7 b/hack/gen-repository-iso/dockerfile.centos7 index e0ed0cfc..0ccb6e03 100644 --- a/hack/gen-repository-iso/dockerfile.centos7 +++ b/hack/gen-repository-iso/dockerfile.centos7 @@ -1,22 +1,43 @@ FROM centos:7 as centos7 + ARG TARGETARCH -ENV OS=centos -ENV OS_VERSION=7 -ARG BUILD_TOOLS="yum-utils createrepo mkisofs epel-release" -ARG DIR=${OS}${OS_VERSION}-${TARGETARCH}-rpms +ARG CENTOS_VERSION=7.9.2009 +ARG DIR=centos7-amd64-rpms +ARG PKGS=".common[],.rpms[]" +ARG BUILD_TOOLS="createrepo genisoimage" -RUN yum install -q -y ${BUILD_TOOLS} \ - && yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \ - && yum makecache +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 -WORKDIR package +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + echo "[base]" > /etc/yum.repos.d/CentOS-Base.repo && \ + echo "name=CentOS-Base" >> /etc/yum.repos.d/CentOS-Base.repo && \ + echo "baseurl=http://vault.centos.org/${CENTOS_VERSION}/os/x86_64/" >> /etc/yum.repos.d/CentOS-Base.repo && \ + echo "enabled=1" >> /etc/yum.repos.d/CentOS-Base.repo && \ + echo "gpgcheck=0" >> /etc/yum.repos.d/CentOS-Base.repo && \ + yum clean all && yum makecache && \ + yum install -y $BUILD_TOOLS && yum clean all; \ + else \ + echo "Skipping yum setup for $TARGETARCH"; \ + fi + +WORKDIR /package COPY packages.yaml . COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq -RUN yq eval ".common[],.rpms[],.${OS}[],.${OS}${OS_VERSION}[]" packages.yaml > packages.list -RUN sort -u packages.list | xargs repotrack -p ${DIR} \ - && createrepo -d ${DIR} \ - && mkisofs -r -o ${DIR}.iso ${DIR} +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + mkdir -p ${DIR} && \ + yq eval "${PKGS}" packages.yaml | while read pkg; do \ + if [ -n "$pkg" ]; then \ + echo "Processing $pkg..."; \ + yum install -y --downloadonly --downloaddir=${DIR} $pkg || echo "not found: $pkg"; \ + fi; \ + done && \ + createrepo ${DIR} && \ + genisoimage -r -o ${DIR}.iso ${DIR}; \ + else \ + echo "Skipping package download for $TARGETARCH"; \ + fi FROM scratch COPY --from=centos7 /package/*.iso / diff --git a/hack/gen-repository-iso/dockerfile.centos8 b/hack/gen-repository-iso/dockerfile.centos8 new file mode 100644 index 00000000..3639bc55 --- /dev/null +++ b/hack/gen-repository-iso/dockerfile.centos8 @@ -0,0 +1,52 @@ +FROM centos:8 as centos8 + +ARG TARGETARCH +ARG DIR=centos8-${TARGETARCH}-rpms +ARG PKGS=".common[],.rpms[]" +ARG BUILD_TOOLS="createrepo_c genisoimage dnf-plugins-core" + +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +RUN rm -f /etc/yum.repos.d/CentOS-*.repo \ + && if [ "$TARGETARCH" = "amd64" ]; then \ + BASEOS="http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/"; \ + APPSTREAM="http://vault.centos.org/8.5.2111/AppStream/x86_64/os/"; \ + else \ + BASEOS="http://vault.centos.org/8.5.2111/BaseOS/aarch64/os/"; \ + APPSTREAM="http://vault.centos.org/8.5.2111/AppStream/aarch64/os/"; \ + fi \ + && echo "[BaseOS]" > /etc/yum.repos.d/centos8-vault.repo \ + && echo "name=CentOS-8 BaseOS" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "baseurl=$BASEOS" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "enabled=1" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "gpgcheck=0" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "[AppStream]" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "name=CentOS-8 AppStream" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "baseurl=$APPSTREAM" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "enabled=1" >> /etc/yum.repos.d/centos8-vault.repo \ + && echo "gpgcheck=0" >> /etc/yum.repos.d/centos8-vault.repo \ + && dnf --disablerepo="*" --enablerepo="BaseOS,AppStream" clean all \ + && dnf --disablerepo="*" --enablerepo="BaseOS,AppStream" makecache + +RUN dnf install -y --setopt=tsflags=nodocs --disablerepo="*" --enablerepo="BaseOS,AppStream" $BUILD_TOOLS \ + && dnf clean all + +WORKDIR /package + +COPY packages.yaml . +COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq + +RUN mkdir -p ${DIR} \ + && yq eval "${PKGS}" packages.yaml | while read pkg; do \ + if [ -n "$pkg" ]; then \ + echo "Downloading $pkg..."; \ + dnf install -y --downloadonly --downloaddir=${DIR} --disablerepo="*" --enablerepo="BaseOS,AppStream" $pkg || echo "not found: $pkg"; \ + fi; \ + done + +RUN createrepo_c ${DIR} \ + && genisoimage -r -o ${DIR}.iso ${DIR} + +FROM scratch +COPY --from=centos8 /package/*.iso / \ No newline at end of file diff --git a/hack/gen-repository-iso/dockerfile.debian10 b/hack/gen-repository-iso/dockerfile.debian10 index 635a124d..68fda3b6 100644 --- a/hack/gen-repository-iso/dockerfile.debian10 +++ b/hack/gen-repository-iso/dockerfile.debian10 @@ -1,33 +1,28 @@ FROM debian:10 as debian10 ARG TARGETARCH -ARG OS_RELEASE=buster -ARG OS_VERSION=10 ARG DIR=debian-10-${TARGETARCH}-debs ARG PKGS=.common[],.debs[],.debian[],.debian10[] -ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage dirmngr" +ARG BUILD_TOOLS="apt-transport-https ca-certificates curl wget gnupg dpkg-dev genisoimage dirmngr" ENV DEBIAN_FRONTEND=noninteractive +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 -# dump system package list -RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list -RUN ARCH=$(dpkg --print-architecture) \ +RUN sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list \ + && sed -i '/security.debian.org/d' /etc/apt/sources.list \ + && echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until \ && apt update -qq \ && apt install -y --no-install-recommends $BUILD_TOOLS \ - && if [ "$TARGETARCH" = "amd64" ]; then \ - curl -fsSL https://download.gluster.org/pub/gluster/glusterfs/7/rsa.pub | apt-key add - ; \ - echo deb https://download.gluster.org/pub/gluster/glusterfs/7/LATEST/Debian/${OS_VERSION}/amd64/apt ${OS_RELEASE} main > /etc/apt/sources.list.d/gluster.list ; \ - fi \ && curl -fsSL "https://download.docker.com/linux/debian/gpg" | apt-key add -qq - \ - && echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/debian ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list \ + && echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list \ && apt update -qq WORKDIR /package COPY packages.yaml . - COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq -RUN yq eval "${PKGS}" packages.yaml >> packages.list \ - && sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls -RUN mkdir -p ${DIR} \ +RUN yq eval "${PKGS}" packages.yaml >> packages.list \ + && sort -u packages.list | xargs -n1 apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls \ + && mkdir -p ${DIR} \ && wget -q -x -P ${DIR} -i packages.urls \ && cd ${DIR} \ && dpkg-scanpackages ./ /dev/null | gzip -9c > ./Packages.gz diff --git a/hack/gen-repository-iso/dockerfile.debian11 b/hack/gen-repository-iso/dockerfile.debian11 index f99dd95f..d3f56e2a 100644 --- a/hack/gen-repository-iso/dockerfile.debian11 +++ b/hack/gen-repository-iso/dockerfile.debian11 @@ -3,7 +3,7 @@ ARG TARGETARCH ARG OS_RELEASE=bullseye ARG OS_VERSION=11 ARG DIR=debian-11-${TARGETARCH}-debs -ARG PKGS=.common[],.debs[],.debian[],.debian11[] +ARG PKGS=".common[],.debs[]" ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage dirmngr" ENV DEBIAN_FRONTEND=noninteractive diff --git a/hack/gen-repository-iso/dockerfile.kylinv10sp1 b/hack/gen-repository-iso/dockerfile.kylinv10sp1 new file mode 100644 index 00000000..841af0a2 --- /dev/null +++ b/hack/gen-repository-iso/dockerfile.kylinv10sp1 @@ -0,0 +1,44 @@ +FROM hxsoong/kylin:v10-sp1 as kylinv10 + +ARG TARGETARCH +ARG DIR=kylin-v10-${TARGETARCH}-rpms +ARG PKGS=".common[],.rpms[]" +ARG BUILD_TOOLS="createrepo_c genisoimage" + +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP1/os/adv/lic/base/x86_64/"; \ + else \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP1/os/adv/lic/base/aarch64/"; \ + fi \ + && echo "[kylin-base]" > /etc/yum.repos.d/kylin.repo \ + && echo "name=Kylin Base" >> /etc/yum.repos.d/kylin.repo \ + && echo "baseurl=$BASEURL" >> /etc/yum.repos.d/kylin.repo \ + && echo "enabled=1" >> /etc/yum.repos.d/kylin.repo \ + && echo "gpgcheck=0" >> /etc/yum.repos.d/kylin.repo \ + && yum clean all \ + && yum makecache --disablerepo="*" --enablerepo="kylin-base" + +RUN yum install -y --disablerepo="*" --enablerepo="kylin-base" $BUILD_TOOLS \ + && yum clean all + +WORKDIR /package + +COPY packages.yaml . +COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq + +RUN mkdir -p ${DIR} \ + && yq eval "${PKGS}" packages.yaml | while read pkg; do \ + if [ -n "$pkg" ]; then \ + echo "Downloading $pkg..."; \ + yum install -y --downloadonly --downloaddir=${DIR} --disablerepo="*" --enablerepo="kylin-base" $pkg || echo "not found: $pkg"; \ + fi; \ + done + +RUN createrepo_c ${DIR} \ + && genisoimage -r -o ${DIR}.iso ${DIR} + +FROM scratch +COPY --from=kylinv10 /package/*.iso / diff --git a/hack/gen-repository-iso/dockerfile.kylinv10sp2 b/hack/gen-repository-iso/dockerfile.kylinv10sp2 new file mode 100644 index 00000000..7b77cae4 --- /dev/null +++ b/hack/gen-repository-iso/dockerfile.kylinv10sp2 @@ -0,0 +1,44 @@ +FROM hxsoong/kylin:v10-sp2 as kylinv10 + +ARG TARGETARCH +ARG DIR=kylin-v10-${TARGETARCH}-rpms +ARG PKGS=".common[],.rpms[]" +ARG BUILD_TOOLS="createrepo_c genisoimage" + +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP2/os/adv/lic/base/x86_64/"; \ + else \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP2/os/adv/lic/base/aarch64/"; \ + fi \ + && echo "[kylin-base]" > /etc/yum.repos.d/kylin.repo \ + && echo "name=Kylin Base" >> /etc/yum.repos.d/kylin.repo \ + && echo "baseurl=$BASEURL" >> /etc/yum.repos.d/kylin.repo \ + && echo "enabled=1" >> /etc/yum.repos.d/kylin.repo \ + && echo "gpgcheck=0" >> /etc/yum.repos.d/kylin.repo \ + && yum clean all \ + && yum makecache --disablerepo="*" --enablerepo="kylin-base" + +RUN yum install -y --disablerepo="*" --enablerepo="kylin-base" $BUILD_TOOLS \ + && yum clean all + +WORKDIR /package + +COPY packages.yaml . +COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq + +RUN mkdir -p ${DIR} \ + && yq eval "${PKGS}" packages.yaml | while read pkg; do \ + if [ -n "$pkg" ]; then \ + echo "Downloading $pkg..."; \ + yum install -y --downloadonly --downloaddir=${DIR} --disablerepo="*" --enablerepo="kylin-base" $pkg || echo "not found: $pkg"; \ + fi; \ + done + +RUN createrepo_c ${DIR} \ + && genisoimage -r -o ${DIR}.iso ${DIR} + +FROM scratch +COPY --from=kylinv10 /package/*.iso / diff --git a/hack/gen-repository-iso/dockerfile.kylinv10sp3 b/hack/gen-repository-iso/dockerfile.kylinv10sp3 new file mode 100644 index 00000000..c3279788 --- /dev/null +++ b/hack/gen-repository-iso/dockerfile.kylinv10sp3 @@ -0,0 +1,44 @@ +FROM hxsoong/kylin:v10-sp3 as kylinv10 + +ARG TARGETARCH +ARG DIR=kylin-v10-${TARGETARCH}-rpms +ARG PKGS=".common[],.rpms[]" +ARG BUILD_TOOLS="createrepo_c genisoimage" + +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP3/os/adv/lic/base/x86_64/"; \ + else \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP3/os/adv/lic/base/aarch64/"; \ + fi \ + && echo "[kylin-base]" > /etc/yum.repos.d/kylin.repo \ + && echo "name=Kylin Base" >> /etc/yum.repos.d/kylin.repo \ + && echo "baseurl=$BASEURL" >> /etc/yum.repos.d/kylin.repo \ + && echo "enabled=1" >> /etc/yum.repos.d/kylin.repo \ + && echo "gpgcheck=0" >> /etc/yum.repos.d/kylin.repo \ + && yum clean all \ + && yum makecache --disablerepo="*" --enablerepo="kylin-base" + +RUN yum install -y --disablerepo="*" --enablerepo="kylin-base" $BUILD_TOOLS \ + && yum clean all + +WORKDIR /package + +COPY packages.yaml . +COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq + +RUN mkdir -p ${DIR} \ + && yq eval "${PKGS}" packages.yaml | while read pkg; do \ + if [ -n "$pkg" ]; then \ + echo "Downloading $pkg..."; \ + yum install -y --downloadonly --downloaddir=${DIR} --disablerepo="*" --enablerepo="kylin-base" $pkg || echo "not found: $pkg"; \ + fi; \ + done + +RUN createrepo_c ${DIR} \ + && genisoimage -r -o ${DIR}.iso ${DIR} + +FROM scratch +COPY --from=kylinv10 /package/*.iso / diff --git a/hack/gen-repository-iso/dockerfile.kylinv10sp3-2403 b/hack/gen-repository-iso/dockerfile.kylinv10sp3-2403 new file mode 100644 index 00000000..734f9077 --- /dev/null +++ b/hack/gen-repository-iso/dockerfile.kylinv10sp3-2403 @@ -0,0 +1,44 @@ +FROM hxsoong/kylin:v10-sp3 as kylinv10 + +ARG TARGETARCH +ARG DIR=kylin-v10-${TARGETARCH}-rpms +ARG PKGS=".common[],.rpms[]" +ARG BUILD_TOOLS="createrepo_c genisoimage" + +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP3-2403/os/adv/lic/base/x86_64/"; \ + else \ + BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP3-2403/os/adv/lic/base/aarch64/"; \ + fi \ + && echo "[kylin-base]" > /etc/yum.repos.d/kylin.repo \ + && echo "name=Kylin Base" >> /etc/yum.repos.d/kylin.repo \ + && echo "baseurl=$BASEURL" >> /etc/yum.repos.d/kylin.repo \ + && echo "enabled=1" >> /etc/yum.repos.d/kylin.repo \ + && echo "gpgcheck=0" >> /etc/yum.repos.d/kylin.repo \ + && yum clean all \ + && yum makecache --disablerepo="*" --enablerepo="kylin-base" + +RUN yum install -y --disablerepo="*" --enablerepo="kylin-base" $BUILD_TOOLS \ + && yum clean all + +WORKDIR /package + +COPY packages.yaml . +COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq + +RUN mkdir -p ${DIR} \ + && yq eval "${PKGS}" packages.yaml | while read pkg; do \ + if [ -n "$pkg" ]; then \ + echo "Downloading $pkg..."; \ + yum install -y --downloadonly --downloaddir=${DIR} --disablerepo="*" --enablerepo="kylin-base" $pkg || echo "not found: $pkg"; \ + fi; \ + done + +RUN createrepo_c ${DIR} \ + && genisoimage -r -o ${DIR}.iso ${DIR} + +FROM scratch +COPY --from=kylinv10 /package/*.iso / diff --git a/hack/gen-repository-iso/dockerfile.ubuntu1604 b/hack/gen-repository-iso/dockerfile.ubuntu1604 index 71969819..78827813 100644 --- a/hack/gen-repository-iso/dockerfile.ubuntu1604 +++ b/hack/gen-repository-iso/dockerfile.ubuntu1604 @@ -2,18 +2,14 @@ FROM ubuntu:16.04 as ubuntu1604 ARG TARGETARCH ARG OS_RELEASE=xenial ARG DIR=ubuntu-16.04-${TARGETARCH}-debs -ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu1604[] +ARG PKGS=".common[],.debs[]" ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage" ENV DEBIAN_FRONTEND=noninteractive # dump system package list RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list RUN apt update -qq \ - && apt install -y --no-install-recommends $BUILD_TOOLS \ - && add-apt-repository ppa:gluster/glusterfs-7 -y \ - && curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \ - && echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list\ - && apt update -qq + && apt install -y --no-install-recommends $BUILD_TOOLS WORKDIR /package COPY packages.yaml . diff --git a/hack/gen-repository-iso/dockerfile.ubuntu1804 b/hack/gen-repository-iso/dockerfile.ubuntu1804 index f9852d8d..7d15f00b 100644 --- a/hack/gen-repository-iso/dockerfile.ubuntu1804 +++ b/hack/gen-repository-iso/dockerfile.ubuntu1804 @@ -2,18 +2,24 @@ FROM ubuntu:18.04 as ubuntu1804 ARG TARGETARCH ARG OS_RELEASE=bionic ARG DIR=ubuntu-18.04-${TARGETARCH}-debs -ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu1804[] +ARG PKGS=".common[],.debs[]" ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage" ENV DEBIAN_FRONTEND=noninteractive +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 -# dump system package list RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list -RUN apt update -qq \ - && apt install -y --no-install-recommends $BUILD_TOOLS \ - && add-apt-repository ppa:gluster/glusterfs-7 -y \ - && curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \ - && echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list\ - && apt update -qq + +RUN apt-get update -qq \ + && apt-get install -y --no-install-recommends ca-certificates apt-transport-https curl wget gnupg \ + && sed -i 's|http://archive.ubuntu.com/ubuntu/|https://mirrors.huaweicloud.com/ubuntu/|g' /etc/apt/sources.list \ + && sed -i 's|http://security.ubuntu.com/ubuntu/|https://mirrors.huaweicloud.com/ubuntu/|g' /etc/apt/sources.list \ + && apt-get update -qq \ + && apt-get install -y --no-install-recommends software-properties-common dpkg-dev genisoimage \ + && add-apt-repository ppa:gluster/glusterfs-7 -y || true \ + && curl -fsSL https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu/gpg | apt-key add - \ + && echo "deb [arch=${TARGETARCH}] https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list \ + && apt-get update -qq WORKDIR /package COPY packages.yaml . @@ -21,7 +27,8 @@ COPY packages.yaml . COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq RUN yq eval "${PKGS}" packages.yaml >> packages.list \ && dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 >> packages.list \ - && sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls + && sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris \ + | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls RUN mkdir -p ${DIR} \ && wget -q -x -P ${DIR} -i packages.urls \ diff --git a/hack/gen-repository-iso/dockerfile.ubuntu2004 b/hack/gen-repository-iso/dockerfile.ubuntu2004 index 9cb4f0b2..950e07bf 100644 --- a/hack/gen-repository-iso/dockerfile.ubuntu2004 +++ b/hack/gen-repository-iso/dockerfile.ubuntu2004 @@ -1,28 +1,24 @@ FROM ubuntu:20.04 as ubuntu2004 ARG TARGETARCH -ARG OS_RELEASE=focal ARG DIR=ubuntu-20.04-${TARGETARCH}-debs -ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu2004[] +ARG PKGS=".common[],.debs[]" ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage" ENV DEBIAN_FRONTEND=noninteractive +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 -# dump system package list RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list + RUN apt update -qq \ - && apt install -y --no-install-recommends $BUILD_TOOLS \ - && add-apt-repository ppa:gluster/glusterfs-7 -y \ - && curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \ - && echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list\ - && apt update -qq + && apt install -y --no-install-recommends $BUILD_TOOLS WORKDIR /package COPY packages.yaml . - COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq -RUN yq eval "${PKGS}" packages.yaml >> packages.list \ - && sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls -RUN mkdir -p ${DIR} \ +RUN yq eval "${PKGS}" packages.yaml >> packages.list \ + && sort -u packages.list | xargs -n1 apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls \ + && mkdir -p ${DIR} \ && wget -q -x -P ${DIR} -i packages.urls \ && cd ${DIR} \ && dpkg-scanpackages ./ /dev/null | gzip -9c > ./Packages.gz diff --git a/hack/gen-repository-iso/dockerfile.ubuntu2204 b/hack/gen-repository-iso/dockerfile.ubuntu2204 index 7a92912a..54d5bcaf 100644 --- a/hack/gen-repository-iso/dockerfile.ubuntu2204 +++ b/hack/gen-repository-iso/dockerfile.ubuntu2204 @@ -2,18 +2,14 @@ FROM ubuntu:22.04 as ubuntu2204 ARG TARGETARCH ARG OS_RELEASE=jammy ARG DIR=ubuntu-22.04-${TARGETARCH}-debs -ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu2204[] +ARG PKGS=".common[],.debs[]" ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage" ENV DEBIAN_FRONTEND=noninteractive # dump system package list RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list RUN apt update -qq \ - && apt install -y --no-install-recommends $BUILD_TOOLS \ - #&& add-apt-repository ppa:gluster/glusterfs-7 -y \ - && curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \ - && echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list\ - && apt update -qq + && apt install -y --no-install-recommends $BUILD_TOOLS WORKDIR /package COPY packages.yaml . diff --git a/hack/gen-repository-iso/dockerfile.ubuntu2404 b/hack/gen-repository-iso/dockerfile.ubuntu2404 index 2ae00138..b422834f 100644 --- a/hack/gen-repository-iso/dockerfile.ubuntu2404 +++ b/hack/gen-repository-iso/dockerfile.ubuntu2404 @@ -2,18 +2,15 @@ FROM ubuntu:24.04 as ubuntu2404 ARG TARGETARCH ARG OS_RELEASE=lunar ARG DIR=ubuntu-24.04-${TARGETARCH}-debs -ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu2404[] +ARG PKGS=".common[],.debs[]" ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage" ENV DEBIAN_FRONTEND=noninteractive # dump system package list RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list RUN apt update -qq \ - && apt install -y --no-install-recommends $BUILD_TOOLS \ - && curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \ - && echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list \ - && apt update -qq - + && apt install -y --no-install-recommends $BUILD_TOOLS + WORKDIR /package COPY packages.yaml . diff --git a/hack/gen-repository-iso/packages.yaml b/hack/gen-repository-iso/packages.yaml index 6d20c9ff..6e437b36 100644 --- a/hack/gen-repository-iso/packages.yaml +++ b/hack/gen-repository-iso/packages.yaml @@ -1,92 +1,35 @@ ---- common: - - curl - - ceph-common - - net-tools - - lvm2 - - telnet - - tcpdump - - socat - - openssl + - bash-completion - chrony - conntrack - curl - - ipvsadm - - ipset - - psmisc - - bash-completion - ebtables + - git - haproxy + - ipset + - ipvsadm - keepalived + - lvm2 + - net-tools + - openssl + - psmisc + - socat + - sudo + - tcpdump + - telnet rpms: - - nfs-utils - - yum-utils - bind-utils - - glusterfs-fuse + - conntrack-tools - lz4 + - nfs-utils - nss - nss-sysinit - nss-tools - - conntrack-tools debs: - apt-transport-https - ca-certificates - dnsutils - - git - - glusterfs-client - gnupg-agent - nfs-common - openssh-server - - software-properties-common - - sudo - -centos: - - containerd.io - -centos7: - - libselinux-python - - docker-ce-20.10.8 - - docker-ce-cli-20.10.8 - -debian: - - containerd.io - -debian10: - - docker-ce=5:20.10.8~3-0~debian-buster - - docker-ce-cli=5:20.10.8~3-0~debian-buster - -debian11: - - docker-ce=5:20.10.8~3-0~debian-bullseye - - docker-ce-cli=5:20.10.8~3-0~debian-bullseye - -ubuntu: - - containerd.io - -ubuntu1604: - - docker-ce=5:20.10.8~3-0~ubuntu-xenial - - docker-ce-cli=5:20.10.8~3-0~ubuntu-xenial - -ubuntu1804: - - docker-ce=5:20.10.8~3-0~ubuntu-bionic - - docker-ce-cli=5:20.10.8~3-0~ubuntu-bionic - -ubuntu2004: - - docker-ce=5:20.10.8~3-0~ubuntu-focal - - docker-ce-cli=5:20.10.8~3-0~ubuntu-focal - -# The minimum version of docker-ce on ubuntu 2204 is 20.10.13 -ubuntu2204: - - docker-ce=5:20.10.13~3-0~ubuntu-jammy - - docker-ce-cli=5:20.10.13~3-0~ubuntu-jammy - -ubuntu2404: - - docker-ce=5:20.10.23~3-0~ubuntu-lunar - - docker-ce-cli=5:20.10.23~3-0~ubuntu-lunar - -almalinux: - - containerd.io - - docker-compose-plugin - -almalinux90: - - docker-ce-20.10.17 - - docker-ce-cli-20.10.17 + - software-properties-common \ No newline at end of file