diff --git a/.github/workflows/call-os-pkgs-build.yaml b/.github/workflows/call-os-pkgs-build.yaml index 0e9025edf..2216b07fc 100644 --- a/.github/workflows/call-os-pkgs-build.yaml +++ b/.github/workflows/call-os-pkgs-build.yaml @@ -15,6 +15,8 @@ jobs: dockerfile: build/os-packages/Dockerfile.redhat7 - name: redhat8 dockerfile: build/os-packages/Dockerfile.redhat8 + - name: redhat9 + dockerfile: build/os-packages/Dockerfile.redhat9 - name: kylinv10 dockerfile: build/os-packages/Dockerfile.kylinv10 - name: openeuler22.03 diff --git a/build/os-packages/Dockerfile.redhat9 b/build/os-packages/Dockerfile.redhat9 new file mode 100644 index 000000000..1ca8c0821 --- /dev/null +++ b/build/os-packages/Dockerfile.redhat9 @@ -0,0 +1,20 @@ +ARG OS_NAME=redhat + +FROM almalinux:9 as os-redhat9 +ARG OS_NAME +ARG OS_VERSION=9 +ARG BUILD_TOOLS="yum-utils createrepo" + +WORKDIR /$OS_NAME/$OS_VERSION/os +COPY build/os-packages/packages.yml . +COPY --from=mikefarah/yq:4.30.8 /usr/bin/yq /usr/bin/yq +RUN yq eval '.common[],.yum[],.redhat9[]' packages.yml > packages.list + +RUN ARCH=$(uname -m) \ + && dnf install -y ${BUILD_TOOLS} \ + && while read -r line; do dnf install -y --downloadonly --downloaddir=${ARCH} ${line}; done <<<"$(sort -u packages.list)" \ + && createrepo -d ${ARCH} + +FROM scratch +ARG OS_NAME +COPY --from=os-redhat9 /$OS_NAME /resources/$OS_NAME diff --git a/build/os-packages/packages.yml b/build/os-packages/packages.yml index 9491fb5b0..4d48fccab 100644 --- a/build/os-packages/packages.yml +++ b/build/os-packages/packages.yml @@ -14,7 +14,7 @@ common: - sshpass # https://docs.docker.com/engine/installation/linux/centos/#install-from-a-package -# https://download.docker.com/linux/centos/>/x86_64/stable/Packages/ +# https://download.docker.com/linux/centos//x86_64/stable/Packages/ # or do 'yum --showduplicates list docker-engine' centos7: - containerd.io-1.4.12-3.1.el7 @@ -34,6 +34,8 @@ redhat8: - docker-ce-3:20.10.20-3.el8 - docker-ce-cli-1:20.10.20-3.el8 +redhat9: [] + kylinv10: - socat - libselinux-python