From d13d80678d4445e63996eed3dfdbe9ed2c9adcfc Mon Sep 17 00:00:00 2001 From: yzewei Date: Wed, 29 May 2024 08:59:19 +0800 Subject: [PATCH] add loong64 support Signed-off-by: yzewei --- .github/workflows/basic-image-push.yml | 3 ++- .jenkins/docker_images_build.sh | 9 +++++++-- openeuler/README.md | 2 +- openeuler/download.sh | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/basic-image-push.yml b/.github/workflows/basic-image-push.yml index a7395e3b..dcb12e8f 100644 --- a/.github/workflows/basic-image-push.yml +++ b/.github/workflows/basic-image-push.yml @@ -66,7 +66,8 @@ jobs: context: ./openeuler/${{ matrix.version }}/ push: true tags: ${{ matrix.tags }} - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64, linux/arm64, linux/loong64 + platforms: ${{ if eq matrix.version '22.03-lts' then 'linux/amd64,linux/arm64,linux/loong64' else 'linux/amd64,linux/arm64' }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.jenkins/docker_images_build.sh b/.jenkins/docker_images_build.sh index ff302ed3..fea765a6 100644 --- a/.jenkins/docker_images_build.sh +++ b/.jenkins/docker_images_build.sh @@ -53,13 +53,18 @@ build_app_os() { local app_name=$1 local app_version=$2 + local platforms="linux/amd64,linux/arm64" for os_version in $(ls -l ${WORKDIR}/${app_name}/${app_version} | grep -v grep | grep ^d | awk '{print $9}') do - ##TODO: consider deduplicate the build of the same docker image + if [[ "$os_version" == "22.03-lts" ]]; then + platforms="${platforms},linux/loong64" + fi + + ##TODO: consider deduplicate the build of the same docker image echo "start to build docker image for ${app_name}-${app_version} on openEuler-${os_version}" cd ${WORKDIR}/${app_name}/${app_version}/${os_version} && \ - docker buildx build -t "${REPOSITORY}/${app_name}:${app_version}-${os_version}" --platform linux/amd64,linux/arm64 . --push + docker buildx build -t "${REPOSITORY}/${app_name}:${app_version}-${os_version}" --platform ${platforms} . --push done } diff --git a/openeuler/README.md b/openeuler/README.md index f90244fc..d486b34f 100644 --- a/openeuler/README.md +++ b/openeuler/README.md @@ -16,7 +16,7 @@ download.sh 2. Build images and push: ```shell -docker buildx build -t "openeuler/openeuler:$VERSION" --platform linux/amd64,linux/arm64 . --push +docker buildx build -t "openeuler/openeuler:$VERSION" --platform linux/amd64,linux/arm64,linux/loong64 . --push ``` We are using `buildx` in here to generate multi-arch images, see more in [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/) diff --git a/openeuler/download.sh b/openeuler/download.sh index 0b6ea81d..772f7d66 100755 --- a/openeuler/download.sh +++ b/openeuler/download.sh @@ -2,7 +2,7 @@ set -ex -archs="x86_64 aarch64" +archs="x86_64 aarch64 loong64" input_version=$1 versions=${input_version:-"20.03-lts 20.03-lts-sp1 20.03-lts-sp2 20.09 21.03 21.09 22.03-lts 22.03-lts-sp1 22.03-lts-sp2 22.09 23.03 23.09"} for ARCH in $archs ; @@ -11,6 +11,8 @@ do DOCKER_ARCH=arm64 elif [[ "$ARCH" = "x86_64" ]];then DOCKER_ARCH=amd64 + elif [[ "$ARCH" = "loong64" && "$versions" = "22.03-lts" ]];then + DOCKER_ARCH=loong64 else echo "Unknow arch: "$ARCH exit 1 -- Gitee