From de36484a7984aa9bae7275ee00da6bcef671fb3d Mon Sep 17 00:00:00 2001 From: dsx137 <70027572+dsx137@users.noreply.github.com> Date: Mon, 12 Oct 2026 16:40:50 +0800 Subject: [PATCH] fix(core): publish multi-architecture images to ACR (#3815) Add ACR-specific build and push steps to the Docker workflows while filtering ACR tags from the primary registry push. --- ...cker-build-and-release-services-images.yml | 13 +++++- .github/workflows/publish-docker-image.yml | 45 ++++++++++++++++--- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-build-and-release-services-images.yml b/.github/workflows/docker-build-and-release-services-images.yml index 27b22be31..74ab8f0e8 100644 --- a/.github/workflows/docker-build-and-release-services-images.yml +++ b/.github/workflows/docker-build-and-release-services-images.yml @@ -149,6 +149,17 @@ jobs: IMAGE_REGISTRIES: | ${{ secrets.DOCKER_USERNAME }} ghcr.io/${{ github.repository_owner }} - registry.cn-hangzhou.aliyuncs.com/openimsdk + run: | + bash build/build_single.sh + + - name: Build and push Docker images to ACR + env: + BUILDX_NO_DEFAULT_ATTESTATIONS: '1' + RELEASE: "true" + PUSH: "true" + SERVICE: ${{ matrix.service }} + PLATFORMS: linux/amd64,linux/arm64 + IMAGE_TAGS: ${{ steps.tags.outputs.tags }} + IMAGE_REGISTRIES: registry.cn-hangzhou.aliyuncs.com/openimsdk run: | bash build/build_single.sh diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index 8e2847d62..ca147f7eb 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -173,13 +173,46 @@ jobs: - name: Push multi-architecture images if: success() + env: + IMAGE_TAGS: ${{ steps.meta.outputs.tags }} run: | - docker buildx build \ - --platform linux/amd64,linux/arm64 \ - $(echo "${{ steps.meta.outputs.tags }}" | sed 's/,/ --tag /g' | sed 's/^/--tag /') \ - --cache-from type=local,src=/tmp/docker-cache \ - --push \ - ./main-repo + set -euo pipefail + tag_args=() + while IFS= read -r tag; do + [[ -n "$tag" ]] || continue + [[ "${tag%%/*}" != *.aliyuncs.com ]] || continue + tag_args+=(--tag "$tag") + done < <(printf '%s\n' "$IMAGE_TAGS" | tr ',' '\n') + + if [[ ${#tag_args[@]} -gt 0 ]]; then + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + "${tag_args[@]}" \ + --cache-from type=local,src=/tmp/docker-cache \ + --push ./main-repo + fi + + - name: Push multi-architecture images to ACR + if: success() + env: + BUILDX_NO_DEFAULT_ATTESTATIONS: '1' + IMAGE_TAGS: ${{ steps.meta.outputs.tags }} + run: | + set -euo pipefail + tag_args=() + while IFS= read -r tag; do + [[ -n "$tag" ]] || continue + [[ "${tag%%/*}" == *.aliyuncs.com ]] || continue + tag_args+=(--tag "$tag") + done < <(printf '%s\n' "$IMAGE_TAGS" | tr ',' '\n') + + if [[ ${#tag_args[@]} -gt 0 ]]; then + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + "${tag_args[@]}" \ + --cache-from type=local,src=/tmp/docker-cache \ + --push ./main-repo + fi - name: Verify multi-platform support run: |