From 10c0957f6ff849628454992d0d960f60c01b8ea7 Mon Sep 17 00:00:00 2001 From: Zhang Dongliang Date: Tue, 5 Sep 2023 12:41:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker=20buildx=20cross=20platform=20docker?= =?UTF-8?q?=20image=20fix):=20=E8=B7=A8=E5=B9=B3=E5=8F=B0=E7=BC=96?= =?UTF-8?q?=E8=AF=91docker=E9=95=9C=E5=83=8F=E6=98=8E=E7=A1=AE=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/docker_push.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/docker_push.sh b/scripts/docker_push.sh index 7e8131da02..7f4d0684a9 100755 --- a/scripts/docker_push.sh +++ b/scripts/docker_push.sh @@ -117,7 +117,13 @@ build_image() { ;; esac else - docker buildx build -t "$tag" -f "$2" "$3" --push + if [[ "$tag" == *"amd64" || "$ARCH" == "" || "$ARCH" == "amd64" || "$ARCH" == "x86_64" || "$ARCH" == "x86" ]]; then + docker buildx build -t "$tag" -f "$file" "$path" --push --platform linux/amd64 + elif [[ "$tag" == *"arm64" || "$ARCH" == "arm64" ]]; then + docker buildx build -t "$tag" -f "$file" "$path" --push --platform linux/amd64 + else + docker buildx build -t "$tag" -f "$file" "$path" --push + fi docker pull "$tag" fi }