@@ -11,9 +11,14 @@ region="$AWS_DEFAULT_REGION"
1111echo " region: ${region} "
1212
1313# login to docker
14- eval $( aws ecr get-login --no-include-email --region ${region} )
1514identity=$( aws sts get-caller-identity --query ' Account' --output text)
1615
16+ COMMAND=" aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $identity .dkr.ecr.$region .amazonaws.com"
17+ # COMMAND="aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/d4n0a3t5"
18+
19+ echo " $COMMAND "
20+ eval $COMMAND
21+
1722repository=$( aws ecr describe-repositories --repository-names $container )
1823echo " repository: ${repository} "
1924
@@ -22,17 +27,24 @@ for tag in amd64 arm64;
2227do
2328 echo $Item
2429 CONTAINER_NAME=${identity} .dkr.ecr.${region} .amazonaws.com/${container} :$tag
30+ # CONTAINER_NAME=public.ecr.aws/d4n0a3t5/$container:$tag
2531 echo $CONTAINER_NAME
2632 docker push " $CONTAINER_NAME "
2733done
2834
2935
3036
37+ # CONTAINER_NAME=public.ecr.aws/d4n0a3t5/$container:latest
38+ # docker manifest create "$CONTAINER_NAME" \
39+ # --amend "public.ecr.aws/d4n0a3t5/${container}:arm64" \
40+ # --amend "public.ecr.aws/d4n0a3t5/${container}:amd64"
3141CONTAINER_NAME=${identity} .dkr.ecr.${region} .amazonaws.com/${container} :latest
42+ docker manifest rm " $CONTAINER_NAME "
3243docker manifest create " $CONTAINER_NAME " \
33- --amend " ${identity} .dkr.ecr.${region} .amazonaws.com/${container} :arm64" \
34- --amend " ${identity} .dkr.ecr.${region} .amazonaws.com/${container} :x86_64"
44+ --amend " ${identity} .dkr.ecr.${region} .amazonaws.com/${container} :arm64" \
45+ --amend " ${identity} .dkr.ecr.${region} .amazonaws.com/${container} :amd64"
46+
3547
3648docker manifest inspect $CONTAINER_NAME
3749
38- docker manifest push " $CONTAINER_NAME "
50+ docker manifest push " $CONTAINER_NAME "
0 commit comments