From 782d9fce518519af4114d93be7a3bec1d3076c8e Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Mon, 16 Jan 2023 14:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Fix=20docker=20ci=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9efc870..a71d2b7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,37 +38,12 @@ jobs: - name: Build run: | - declare -a IMAGES - - echo "Build amd64" docker buildx build \ --cache-from "type=local,src=/tmp/.buildx-cache" \ --cache-to "type=local,dest=/tmp/.buildx-cache" \ --output "type=image,push=true" \ - --platform linux/amd64 \ + --platform "linux/amd64,linux/arm64/v8" \ --build-arg "S6_ARCH=amd64" \ - --tag "${DOCKERHUB_REPOSITORY}:latest-amd64" \ + --tag "${DOCKERHUB_REPOSITORY}:latest" \ -f Dockerfile \ . - IMAGES+=( "${DOCKERHUB_REPOSITORY}:latest-amd64" ) - - echo "Build arm64-v8" - docker buildx build \ - --cache-from "type=local,src=/tmp/.buildx-cache" \ - --cache-to "type=local,dest=/tmp/.buildx-cache" \ - --output "type=image,push=true" \ - --platform linux/arm64/v8 \ - --build-arg "S6_ARCH=aarch64" \ - --tag "${DOCKERHUB_REPOSITORY}:latest-arm64-v8" \ - -f Dockerfile \ - . - IMAGES+=( "${DOCKERHUB_REPOSITORY}:latest-arm64-v8" ) - - echo "Create manifest lists" - docker manifest create "${DOCKERHUB_REPOSITORY}:latest" "${IMAGES[@]}" - - echo "Annotate manifest lists to add architecture variants that aren't picked up automatically" - docker manifest annotate "${DOCKERHUB_REPOSITORY}:latest" "${DOCKERHUB_REPOSITORY}:latest-arm64-v8" --variant "v8" - - echo "Push manifest lists & delete local copies" - docker manifest push --purge "${DOCKERHUB_REPOSITORY}:latest"