[Solved]AWS ECR keep waiting: --profile is created using aws configure --profile
Reference: https://stackoverflow.com/a/70453287/1802483
Problem:
- You are trying to push a docker image to ECR
- While you use the command provided by AWS and show "Login successfully" when running this command: `aws ecr get-login-password --region <your_region> | docker login --username AWS --password-stdin <aws-account-id>.dkr.ecr.<your-region>.amazonaws.com`, you still saw "Waiting" or "Preparing" when you run `docker push`
Possible reason and solution:
- Chances are you are using multiple AWS accounts
- You need to "login" to correct AWS ECR account when you run `aws ecr get-login-password`
- If you read the link above, you would see a parameter called `--profile`
- `--profile` is actually created using `aws configure --profile <your_profile_name>`
- i.e. To push to your ECR using correct account, you need to create a new profile by running `aws configure --profile <your_new_profile_name>`
- To create a new profile, you need ACCESS_KEY_ID and ACCESS_SECRET, not AWS user account and password.
- If you don't have one, create one for yourself or ask your AWS admin to create one for you.
- Make sure your account can push to AWS ECR.
- Just in case you want to make changes to your aws profile, you can edit the file using your favorite text editor
- Windows: C:\Users\<your_user_name>\.aws\
- \config
- \credentials
- Linux: ~/.aws
- Once you create your profile, run this:
- `aws ecr get-login-password --region <your_region> --profile <your_newly_created_profile_name> | docker login --username AWS --password-stdin <aws-account-id>.dkr.ecr.<your-region>.amazonaws.com`
- You can push to AWS ECR now.
Comments