Skip to content

Commit 12963af

Browse files
committed
Update gen-repository-iso.yaml
Signed-off-by: redscholar <blacktiledhouse@gmail.com> Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> Signed-off-by: redscholar <blacktiledhouse@gmail.com>
1 parent 99aa29d commit 12963af

13 files changed

+194
-155
lines changed

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

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@ on:
99
jobs:
1010
build:
1111
if: startsWith(github.ref, 'refs/tags/')
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
include:
1717
- name: almalinux-9.0-rpms
1818
dockerfile: dockerfile.almalinux90
19-
- name: debian10-debs
19+
- name: centos-8-rpms
20+
dockerfile: dockerfile.centos8
21+
- name: debian-10-debs
2022
dockerfile: dockerfile.debian10
21-
- name: debian11-debs
23+
- name: debian-11-debs
2224
dockerfile: dockerfile.debian11
23-
- name: debian12-debs
24-
dockerfile: dockerfile.debian12
25+
- name: kylin-v10SP3-rpms
26+
dockerfile: dockerfile.kylinv10sp3
2527
- name: ubuntu-18.04-debs
2628
dockerfile: dockerfile.ubuntu1804
2729
- name: ubuntu-20.04-debs
@@ -55,22 +57,12 @@ jobs:
5557
mv ./output/linux_arm64/*.iso ${{ matrix.name }}-arm64.iso
5658
sha256sum *.iso > ${{ matrix.name }}.iso.sha256sum.txt
5759
58-
- name: Wait for release workflow to finish
59-
uses: lewagon/wait-on-check-action@v1.3.4
60-
with:
61-
ref: ${{ github.ref }}
62-
check-name: 'create draft release'
63-
repo-token: ${{ secrets.GITHUB_TOKEN }}
64-
wait-interval: 10
65-
allowed-conclusions: success
66-
6760
- name: Release and upload packages
6861
if: startsWith(github.ref, 'refs/tags/')
6962
uses: softprops/action-gh-release@v2
7063
env:
7164
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7265
with:
73-
draft: true
7466
files: |
7567
${{ matrix.name }}.iso.sha256sum.txt
7668
${{ matrix.name }}-amd64.iso

hack/gen-repository-iso/dockerfile.almalinux90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM almalinux:9.0 as almalinux90
22
ARG TARGETARCH
33
ARG BUILD_TOOLS="dnf-plugins-core createrepo mkisofs epel-release"
44
ARG DIR=almalinux-9.0-${TARGETARCH}-rpms
5-
ARG PKGS=.common[],.rpms[],.almalinux[],.almalinux90[]
5+
ARG PKGS=".common[],.rpms[]"
66

77
RUN dnf install -q -y ${BUILD_TOOLS} \
88
&& dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \
Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,43 @@
11
FROM centos:7 as centos7
2+
23
ARG TARGETARCH
3-
ENV OS=centos
4-
ENV OS_VERSION=7
5-
ARG BUILD_TOOLS="yum-utils createrepo mkisofs epel-release"
6-
ARG DIR=${OS}${OS_VERSION}-${TARGETARCH}-rpms
4+
ARG CENTOS_VERSION=7.9.2009
5+
ARG DIR=centos7-amd64-rpms
6+
ARG PKGS=".common[],.rpms[]"
7+
ARG BUILD_TOOLS="createrepo genisoimage"
8+
9+
ENV LANG=en_US.UTF-8
10+
ENV LC_ALL=en_US.UTF-8
711

8-
RUN yum install -q -y ${BUILD_TOOLS} \
9-
&& yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \
10-
&& yum makecache
12+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
13+
echo "[base]" > /etc/yum.repos.d/CentOS-Base.repo && \
14+
echo "name=CentOS-Base" >> /etc/yum.repos.d/CentOS-Base.repo && \
15+
echo "baseurl=http://vault.centos.org/${CENTOS_VERSION}/os/x86_64/" >> /etc/yum.repos.d/CentOS-Base.repo && \
16+
echo "enabled=1" >> /etc/yum.repos.d/CentOS-Base.repo && \
17+
echo "gpgcheck=0" >> /etc/yum.repos.d/CentOS-Base.repo && \
18+
yum clean all && yum makecache && \
19+
yum install -y $BUILD_TOOLS && yum clean all; \
20+
else \
21+
echo "Skipping yum setup for $TARGETARCH"; \
22+
fi
1123

12-
WORKDIR package
24+
WORKDIR /package
1325
COPY packages.yaml .
1426
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq
15-
RUN yq eval ".common[],.rpms[],.${OS}[],.${OS}${OS_VERSION}[]" packages.yaml > packages.list
1627

17-
RUN sort -u packages.list | xargs repotrack -p ${DIR} \
18-
&& createrepo -d ${DIR} \
19-
&& mkisofs -r -o ${DIR}.iso ${DIR}
28+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
29+
mkdir -p ${DIR} && \
30+
yq eval "${PKGS}" packages.yaml | while read pkg; do \
31+
if [ -n "$pkg" ]; then \
32+
echo "Processing $pkg..."; \
33+
yum install -y --downloadonly --downloaddir=${DIR} $pkg || echo "not found: $pkg"; \
34+
fi; \
35+
done && \
36+
createrepo ${DIR} && \
37+
genisoimage -r -o ${DIR}.iso ${DIR}; \
38+
else \
39+
echo "Skipping package download for $TARGETARCH"; \
40+
fi
2041

2142
FROM scratch
2243
COPY --from=centos7 /package/*.iso /
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM centos:8 as centos8
2+
3+
ARG TARGETARCH
4+
ARG DIR=centos8-${TARGETARCH}-rpms
5+
ARG PKGS=".common[],.rpms[]"
6+
ARG BUILD_TOOLS="createrepo_c genisoimage dnf-plugins-core"
7+
8+
ENV LANG=en_US.UTF-8
9+
ENV LC_ALL=en_US.UTF-8
10+
11+
RUN rm -f /etc/yum.repos.d/CentOS-*.repo \
12+
&& if [ "$TARGETARCH" = "amd64" ]; then \
13+
BASEOS="http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/"; \
14+
APPSTREAM="http://vault.centos.org/8.5.2111/AppStream/x86_64/os/"; \
15+
else \
16+
BASEOS="http://vault.centos.org/8.5.2111/BaseOS/aarch64/os/"; \
17+
APPSTREAM="http://vault.centos.org/8.5.2111/AppStream/aarch64/os/"; \
18+
fi \
19+
&& echo "[BaseOS]" > /etc/yum.repos.d/centos8-vault.repo \
20+
&& echo "name=CentOS-8 BaseOS" >> /etc/yum.repos.d/centos8-vault.repo \
21+
&& echo "baseurl=$BASEOS" >> /etc/yum.repos.d/centos8-vault.repo \
22+
&& echo "enabled=1" >> /etc/yum.repos.d/centos8-vault.repo \
23+
&& echo "gpgcheck=0" >> /etc/yum.repos.d/centos8-vault.repo \
24+
&& echo "[AppStream]" >> /etc/yum.repos.d/centos8-vault.repo \
25+
&& echo "name=CentOS-8 AppStream" >> /etc/yum.repos.d/centos8-vault.repo \
26+
&& echo "baseurl=$APPSTREAM" >> /etc/yum.repos.d/centos8-vault.repo \
27+
&& echo "enabled=1" >> /etc/yum.repos.d/centos8-vault.repo \
28+
&& echo "gpgcheck=0" >> /etc/yum.repos.d/centos8-vault.repo \
29+
&& dnf --disablerepo="*" --enablerepo="BaseOS,AppStream" clean all \
30+
&& dnf --disablerepo="*" --enablerepo="BaseOS,AppStream" makecache
31+
32+
RUN dnf install -y --setopt=tsflags=nodocs --disablerepo="*" --enablerepo="BaseOS,AppStream" $BUILD_TOOLS \
33+
&& dnf clean all
34+
35+
WORKDIR /package
36+
37+
COPY packages.yaml .
38+
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq
39+
40+
RUN mkdir -p ${DIR} \
41+
&& yq eval "${PKGS}" packages.yaml | while read pkg; do \
42+
if [ -n "$pkg" ]; then \
43+
echo "Downloading $pkg..."; \
44+
dnf install -y --downloadonly --downloaddir=${DIR} --disablerepo="*" --enablerepo="BaseOS,AppStream" $pkg || echo "not found: $pkg"; \
45+
fi; \
46+
done
47+
48+
RUN createrepo_c ${DIR} \
49+
&& genisoimage -r -o ${DIR}.iso ${DIR}
50+
51+
FROM scratch
52+
COPY --from=centos8 /package/*.iso /

hack/gen-repository-iso/dockerfile.debian10

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
FROM debian:10 as debian10
22
ARG TARGETARCH
3-
ARG OS_RELEASE=buster
4-
ARG OS_VERSION=10
53
ARG DIR=debian-10-${TARGETARCH}-debs
64
ARG PKGS=.common[],.debs[],.debian[],.debian10[]
7-
ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage dirmngr"
5+
ARG BUILD_TOOLS="apt-transport-https ca-certificates curl wget gnupg dpkg-dev genisoimage dirmngr"
86
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV LANG=en_US.UTF-8
8+
ENV LC_ALL=en_US.UTF-8
99

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) \
10+
RUN sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list \
11+
&& sed -i '/security.debian.org/d' /etc/apt/sources.list \
12+
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until \
1313
&& apt update -qq \
1414
&& apt install -y --no-install-recommends $BUILD_TOOLS \
15-
&& if [ "$TARGETARCH" = "amd64" ]; then \
16-
curl -fsSL https://download.gluster.org/pub/gluster/glusterfs/7/rsa.pub | apt-key add - ; \
17-
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 ; \
18-
fi \
1915
&& curl -fsSL "https://download.docker.com/linux/debian/gpg" | apt-key add -qq - \
20-
&& echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/debian ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list \
16+
&& echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list \
2117
&& apt update -qq
2218

2319
WORKDIR /package
2420
COPY packages.yaml .
25-
2621
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq
27-
RUN yq eval "${PKGS}" packages.yaml >> packages.list \
28-
&& sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls
2922

30-
RUN mkdir -p ${DIR} \
23+
RUN yq eval "${PKGS}" packages.yaml >> packages.list \
24+
&& sort -u packages.list | xargs -n1 apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls \
25+
&& mkdir -p ${DIR} \
3126
&& wget -q -x -P ${DIR} -i packages.urls \
3227
&& cd ${DIR} \
3328
&& dpkg-scanpackages ./ /dev/null | gzip -9c > ./Packages.gz

hack/gen-repository-iso/dockerfile.debian11

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG TARGETARCH
33
ARG OS_RELEASE=bullseye
44
ARG OS_VERSION=11
55
ARG DIR=debian-11-${TARGETARCH}-debs
6-
ARG PKGS=.common[],.debs[],.debian[],.debian11[]
6+
ARG PKGS=".common[],.debs[]"
77
ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage dirmngr"
88
ENV DEBIAN_FRONTEND=noninteractive
99

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM hxsoong/kylin:v10-sp3 as kylinv10
2+
3+
ARG TARGETARCH
4+
ARG DIR=kylin-v10-${TARGETARCH}-rpms
5+
ARG PKGS=".common[],.rpms[]"
6+
ARG BUILD_TOOLS="createrepo_c genisoimage"
7+
8+
ENV LANG=en_US.UTF-8
9+
ENV LC_ALL=en_US.UTF-8
10+
11+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
12+
BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP3/os/adv/lic/base/x86_64/"; \
13+
else \
14+
BASEURL="https://update.cs2c.com.cn/NS/V10/V10SP3/os/adv/lic/base/aarch64/"; \
15+
fi \
16+
&& echo "[kylin-base]" > /etc/yum.repos.d/kylin.repo \
17+
&& echo "name=Kylin Base" >> /etc/yum.repos.d/kylin.repo \
18+
&& echo "baseurl=$BASEURL" >> /etc/yum.repos.d/kylin.repo \
19+
&& echo "enabled=1" >> /etc/yum.repos.d/kylin.repo \
20+
&& echo "gpgcheck=0" >> /etc/yum.repos.d/kylin.repo \
21+
&& yum clean all \
22+
&& yum makecache --disablerepo="*" --enablerepo="kylin-base"
23+
24+
RUN yum install -y --disablerepo="*" --enablerepo="kylin-base" $BUILD_TOOLS \
25+
&& yum clean all
26+
27+
WORKDIR /package
28+
29+
COPY packages.yaml .
30+
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq
31+
32+
RUN mkdir -p ${DIR} \
33+
&& yq eval "${PKGS}" packages.yaml | while read pkg; do \
34+
if [ -n "$pkg" ]; then \
35+
echo "Downloading $pkg..."; \
36+
yum install -y --downloadonly --downloaddir=${DIR} --disablerepo="*" --enablerepo="kylin-base" $pkg || echo "not found: $pkg"; \
37+
fi; \
38+
done
39+
40+
RUN createrepo_c ${DIR} \
41+
&& genisoimage -r -o ${DIR}.iso ${DIR}
42+
43+
FROM scratch
44+
COPY --from=kylinv10 /package/*.iso /

hack/gen-repository-iso/dockerfile.ubuntu1604

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ FROM ubuntu:16.04 as ubuntu1604
22
ARG TARGETARCH
33
ARG OS_RELEASE=xenial
44
ARG DIR=ubuntu-16.04-${TARGETARCH}-debs
5-
ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu1604[]
5+
ARG PKGS=".common[],.debs[]"
66
ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage"
77
ENV DEBIAN_FRONTEND=noninteractive
88

99
# dump system package list
1010
RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list
1111
RUN apt update -qq \
12-
&& apt install -y --no-install-recommends $BUILD_TOOLS \
13-
&& add-apt-repository ppa:gluster/glusterfs-7 -y \
14-
&& curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \
15-
&& echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list\
16-
&& apt update -qq
12+
&& apt install -y --no-install-recommends $BUILD_TOOLS
1713

1814
WORKDIR /package
1915
COPY packages.yaml .

hack/gen-repository-iso/dockerfile.ubuntu1804

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,33 @@ FROM ubuntu:18.04 as ubuntu1804
22
ARG TARGETARCH
33
ARG OS_RELEASE=bionic
44
ARG DIR=ubuntu-18.04-${TARGETARCH}-debs
5-
ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu1804[]
5+
ARG PKGS=".common[],.debs[]"
66
ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage"
77
ENV DEBIAN_FRONTEND=noninteractive
8+
ENV LANG=en_US.UTF-8
9+
ENV LC_ALL=en_US.UTF-8
810

9-
# dump system package list
1011
RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list
11-
RUN apt update -qq \
12-
&& apt install -y --no-install-recommends $BUILD_TOOLS \
13-
&& add-apt-repository ppa:gluster/glusterfs-7 -y \
14-
&& curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \
15-
&& echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list\
16-
&& apt update -qq
12+
13+
RUN apt-get update -qq \
14+
&& apt-get install -y --no-install-recommends ca-certificates apt-transport-https curl wget gnupg \
15+
&& sed -i 's|http://archive.ubuntu.com/ubuntu/|https://mirrors.huaweicloud.com/ubuntu/|g' /etc/apt/sources.list \
16+
&& sed -i 's|http://security.ubuntu.com/ubuntu/|https://mirrors.huaweicloud.com/ubuntu/|g' /etc/apt/sources.list \
17+
&& apt-get update -qq \
18+
&& apt-get install -y --no-install-recommends software-properties-common dpkg-dev genisoimage \
19+
&& add-apt-repository ppa:gluster/glusterfs-7 -y || true \
20+
&& curl -fsSL https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu/gpg | apt-key add - \
21+
&& echo "deb [arch=${TARGETARCH}] https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list \
22+
&& apt-get update -qq
1723

1824
WORKDIR /package
1925
COPY packages.yaml .
2026

2127
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq
2228
RUN yq eval "${PKGS}" packages.yaml >> packages.list \
2329
&& dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 >> packages.list \
24-
&& sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls
30+
&& sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris \
31+
| awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls
2532

2633
RUN mkdir -p ${DIR} \
2734
&& wget -q -x -P ${DIR} -i packages.urls \

hack/gen-repository-iso/dockerfile.ubuntu2004

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
FROM ubuntu:20.04 as ubuntu2004
22
ARG TARGETARCH
3-
ARG OS_RELEASE=focal
43
ARG DIR=ubuntu-20.04-${TARGETARCH}-debs
5-
ARG PKGS=.common[],.debs[],.ubuntu[],.ubuntu2004[]
4+
ARG PKGS=".common[],.debs[]"
65
ARG BUILD_TOOLS="apt-transport-https software-properties-common ca-certificates curl wget gnupg dpkg-dev genisoimage"
76
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV LANG=en_US.UTF-8
8+
ENV LC_ALL=en_US.UTF-8
89

9-
# dump system package list
1010
RUN dpkg --get-selections | grep -v deinstall | cut -f1 | cut -d ':' -f1 > packages.list
11+
1112
RUN apt update -qq \
12-
&& apt install -y --no-install-recommends $BUILD_TOOLS \
13-
&& add-apt-repository ppa:gluster/glusterfs-7 -y \
14-
&& curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - \
15-
&& echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" > /etc/apt/sources.list.d/docker.list\
16-
&& apt update -qq
13+
&& apt install -y --no-install-recommends $BUILD_TOOLS
1714

1815
WORKDIR /package
1916
COPY packages.yaml .
20-
2117
COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq
22-
RUN yq eval "${PKGS}" packages.yaml >> packages.list \
23-
&& sort -u packages.list | xargs apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls
2418

25-
RUN mkdir -p ${DIR} \
19+
RUN yq eval "${PKGS}" packages.yaml >> packages.list \
20+
&& sort -u packages.list | xargs -n1 apt-get install --yes --reinstall --print-uris | awk -F "'" '{print $2}' | grep -v '^$' | sort -u > packages.urls \
21+
&& mkdir -p ${DIR} \
2622
&& wget -q -x -P ${DIR} -i packages.urls \
2723
&& cd ${DIR} \
2824
&& dpkg-scanpackages ./ /dev/null | gzip -9c > ./Packages.gz

0 commit comments

Comments
 (0)