From 3d5ae13020e6fa92d5d546f1befb5e127d79506b Mon Sep 17 00:00:00 2001 From: jessweb3mars Date: Wed, 17 Jul 2024 17:11:03 +0800 Subject: [PATCH] Add multiple platform. --- scripts/ecr_upload_image.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ecr_upload_image.sh b/scripts/ecr_upload_image.sh index b39ff30..d227edd 100755 --- a/scripts/ecr_upload_image.sh +++ b/scripts/ecr_upload_image.sh @@ -15,12 +15,12 @@ current_branch=$(git rev-parse --abbrev-ref HEAD) # Generate the Docker image tag by combining the version and the latest commit hash image_tag="${AWS_ECR_REPOSITORY_NAME}:${current_branch}-${latest_commit}" -sudo docker build --no-cache -t $image_tag . +docker buildx build --platform linux/amd64,linux/arm64 --no-cache -t $image_tag . image_uri="${AWS_ECR_REGISTRY_URI}/${image_tag}" -sudo docker tag $image_tag $image_uri +docker tag $image_tag $image_uri -sudo docker push $image_uri +docker push $image_uri echo $image_uri