ECRのパブリックレポジトリをCLIから作成する
Posted: | Categories: cheatsheet | Tags: AWS, aws-cli, cheatsheet, ECR
2021/09/10 時点だと --region us-east-1 が必要だった。でないと Could not connect to the endpoint URL: "https://api.ecr-public.ap-northeast-1.amazonaws.com/" というエラーがでる。AWS 管理コンソール上は東京リージョンで存在を確認できる。 作成 AWS 管理コンソールでの作り方は パブリックリポジトリの作成 aws ecr-public create-repository --repository-name hogehoge --region us-east-1 削除 aws ecr-public delete-repository --repository-name hogehoge --region us-east-1 push までの流れ push する前にログインする( public とはいえ push にはログインが必要 ビルドする タグづけをする push aws ecr-public get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin public.ecr.aws/hoge docker build -t test-20210910-1 . docker tag test-20210910-1:latest public.ecr.aws/hoge/test-20210910-1:latest docker push public. Read more...