2022.03.20  

【AWS】ECRにイメージをプッシュ時にRetrying EOFになる

AWS    

公式の手順通りにプッシュを行なってもRetrying ~ EOFが出力され、プッシュが行えなくて困りました。

Admin権限で作業していたので、権限については問題ありませんでした。

■ECR Dockerイメージ プッシュ手順
https://docs.aws.amazon.com/ja_jp/AmazonECR/latest/userguide/docker-push-ecr-image.html

■実行コマンド

aws ecr get-login-password --region ap-northeast-1 \
| docker login --username AWS \
--password-stdin 199999999999.dkr.ecr.ap-northeast-1.amazonaws.com

■実行結果

docker push 199999999999.dkr.ecr.ap-northeast-1.amazonaws.com/hello-world-ecs:latest
The push refers to repository [199999999999.dkr.ecr.ap-northeast-1.amazonaws.com/hello-world-ecs]
efcc051bc5fd: Retrying in 1 seconds 
21137b645d66: Retrying in 1 seconds 
d03347ef6763: Retrying in 1 seconds 
2793e844dc34: Retrying in 1 seconds 
8b8ecda4d42d: Retrying in 1 seconds 
30c00b2381a1: Waiting 
3a611bb08c24: Waiting 
EOF

原因

~/.aws/configdefault以外のプロファイルに対してプッシュしようとしていたため。
今回は環境my_profileに対してプッシュを行いたかったので、--profileオプションを利用し、明示的にプロファイルを指定したところ上手くプッシュできました。

※ 他のaws関連コマンドも--profileオプションを使用しないと接続エラーになりがちなので、認証系のエラーが出たらとりあえずこのオプションを使用すると上手くいったりする。

■実行コマンド

aws ecr get-login-password --region ap-northeast-1 \
--profile my_profile \  # このオプションを追加
| docker login --username AWS \
--password-stdin 199999999999.dkr.ecr.ap-northeast-1.amazonaws.com

■実行結果

efed444bc5fd: Pushed 
24333b645d66: Pushed 
d00111ef6763: Pushed 
2793e111dc34: Pushed 
8b8ecda1d00d: Pushed 
30c00b5791a1: Pushed 
3a343bb08c24: Pushed 
コメント
現在コメントはありません。
コメントする
コメント入力

名前 (※ 必須)

メールアドレス (※ 必須 画面には表示されません)

送信