New Amazon Linux Container Image for Cloud and On-Premises Workloads | AWS Blog
こんなリリースがあったけど、ecrとイチャイチャしたり、色々めんどくさいから、手元で使いやすいように
規約的に大丈夫かわからないので自己責任で
#!/bin/bash if [ $# -ne 1 ] then echo "USAGE: $0 {MY_REPOSITORY}" echo " " exit; fi REPOSITORY=$1 LOGIN_CMD=$(aws ecr get-login --registry-ids 137112412989) eval "$LOGIN_CMD" for image in $(aws ecr list-images --registry-id 137112412989 --repository-name amazonlinux |jq -r .imageIds[].imageTag); do docker pull 137112412989.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:${image} echo "IMAGE reTAG=========================================================" docker images |grep "amazonaws.com/amazonlinux" |grep "${image}" | perl -anle 'print "$F[2]"' | xargs -I{} docker tag {} ${REPOSITORY}/amazonlinux:${image} echo "IMAGE push=========================================================" docker push ${REPOSITORY}/amazonlinux:${image} done