Skip to content

Commit

Permalink
Merge pull request #1354 from tu1h/support_rocky8
Browse files Browse the repository at this point in the history
Support Rocky Linux 8
  • Loading branch information
ErikJiang authored Aug 30, 2024
2 parents dbb8350 + fb9807b commit a1f196b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/os-pkgs-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{ "name": "redhat7", "dockerfile":"build/os-packages/Dockerfile.redhat7"},
{ "name": "redhat8", "dockerfile":"build/os-packages/Dockerfile.redhat8"},
{ "name": "redhat9", "dockerfile":"build/os-packages/Dockerfile.redhat9"},
{ "name": "rocky8", "dockerfile":"build/os-packages/Dockerfile.rocky8"},
{ "name": "rocky9", "dockerfile":"build/os-packages/Dockerfile.rocky9"},
{ "name": "kylin-v10sp2", "dockerfile":"build/os-packages/Dockerfile.kylin-v10sp2"},
{ "name": "kylin-v10sp3", "dockerfile":"build/os-packages/Dockerfile.kylin-v10sp3"},
Expand Down
3 changes: 3 additions & 0 deletions artifacts/import_iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ function iso::import_data() {
if [ -d "${iso_mnt_path}/minimal" ]; then
path_list+=("${iso_mnt_path}/minimal")
fi
if [ -d "${iso_mnt_path}/Minimal" ]; then
path_list+=("${iso_mnt_path}/Minimal")
fi

if [ "${#path_list[@]}" -le 0 ]; then
echo "cannot find valid repo data from ${iso_file_path}"
Expand Down
25 changes: 25 additions & 0 deletions build/os-packages/Dockerfile.rocky8
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG OS_NAME=rocky

FROM rockylinux:8 as os-rocky8
ARG OS_NAME
ARG OS_VERSION=8
ARG BUILD_TOOLS="yum-utils createrepo epel-release wget modulemd-tools findutils"

WORKDIR /$OS_NAME/$OS_VERSION/os
COPY build/os-packages/packages.yml .
COPY build/os-packages/repos/centos8.repo /etc/yum.repos.d/
COPY --from=mikefarah/yq:4.30.8 /usr/bin/yq /usr/bin/yq
RUN yq eval '.common[],.yum[],.rocky8[]' packages.yml > packages.list

RUN ARCH=$(uname -m) \
&& dnf install -q -y ${BUILD_TOOLS} \
&& yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \
&& dnf makecache \
&& sort -u packages.list | xargs repotrack --destdir ${ARCH} \
&& createrepo_c ${ARCH} \
&& repo2module -s stable ${ARCH} ${ARCH}/modules.yaml \
&& modifyrepo_c --mdtype=modules ${ARCH}/modules.yaml ${ARCH}/repodata

FROM scratch
ARG OS_NAME
COPY --from=os-rocky8 /$OS_NAME /resources/$OS_NAME
4 changes: 2 additions & 2 deletions build/os-packages/check_rebuild_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fi

git diff --quiet "${prev_tag}" "${late_tag}" "build/os-packages/Dockerfile.${OS_NAME}" || { echo "true"; exit; }

# centos7 / kylinv10 / redhat7 / redhat8
if [[ "${OS_NAME}" == "centos"* ]] || [[ "${OS_NAME}" == "kylin"* ]] || [[ "${OS_NAME}" == "redhat"* ]] || [[ "${OS_NAME}" == "oracle"* ]] || [[ "${OS_NAME}" == "tencent"* ]]; then
# centos / kylinv / redhat / rocky / oracle / tencent / openEuler
if [[ "${OS_NAME}" =~ ^(centos|kylin|redhat|rocky|oracle|tencent|openeuler).* ]]; then
os_key="${OS_NAME/-v10sp*/}"
late_digest=$(echo "${late_packages_yml}" | yq eval ".common[],.yum[],.${os_key}[]" | sort | sha1sum | awk '{print $1}')
prev_digest=$(echo "${prev_packages_yml}" | yq eval ".common[],.yum[],.${os_key}[]" | sort | sha1sum | awk '{print $1}')
Expand Down
11 changes: 11 additions & 0 deletions build/os-packages/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ redhat8:
redhat9:
- container-selinux

rocky8:
- container-selinux
- socat
- container-selinux-2.167.0
- containerd.io-1.6.28-3.1.el8
- containerd.io-1.6.32-3.1.el8
- docker-ce-3:24.0.9-1.el8
- docker-ce-cli-1:24.0.9-1.el8
- docker-ce-3:26.1.2-1.el8
- docker-ce-cli-1:26.1.2-1.el8

rocky9:
- container-selinux
- socat
Expand Down

0 comments on commit a1f196b

Please sign in to comment.