基本コマンド
# Retrieve the login command & log in Docker with that command
$(aws ecr get-login — no-include-email — region ap-northeast-1)
# attach tag to local docker image
docker tag LocalDockerImage TagName
# push the image (specify image by tag)
docker push TagName
Docker Imageのtagに関する理解(要確認)
1つのDocker Imageには複数のタグを付けられる。
TagName = (RepositryName)/(ImageName):(Version)
このRepositoryNameはpush先のECRのrepo名と同じにする必要がある。
ECRのrepo名 = 111122223333.dkr.ecr.ap-northeast-1.amazonaws.com とか
つまり複数のレポに同一imageをpushするにはそのimageにレポの数だけの異なるタグを付けてやる必要がある。