4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ECRにdocker pushした時のRetrying EOF

Last updated at Posted at 2023-05-01

Error

$ docker push aws_account_id.dkr.ecr.region.amazonaws.com/my-repository:tag
The push refers to repository [aws_account_id.dkr.ecr.region.amazonaws.com/my-repository]
************: Retrying in 1 second
************: Retrying in 1 second
************: Retrying in 1 second
************: Retrying in 1 second
************: Retrying in 1 second
************: Retrying in 5 seconds
************: Retrying in 5 seconds
************: Retrying in 5 seconds
************: Retrying in 5 seconds
************: Waiting
EOF

原因

以前aws cli v2をインストールしたときに設定したconfig関連のdefault情報(~/.aws/config, ~/.aws/credentials)はその当時使用していたAWSアカウントの情報だったが、現在は別のIAMユーザーを使用しているため、アクセスキーやシークレットアクセスキーの情報が違っていた。

対策

アクセスキー等を作成していない場合は、以下に沿って作成。
https://docs.aws.amazon.com/ja_jp/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey

新しいユーザーの設定
()内は各自のものを記入。defaultのregionやoutput formatはとりあえずap-northeast-1、jsonで良いと思います。(もちろんこれ以外でも可。)

$ aws configure --profile (your_profile_name)
AWS Access Key ID [None]: (yours)
AWS Secret Access Key [None]: (yours)
Default region name [None]: ap-northeast-1
Default output format [None]: json
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?