- Newest
- Most votes
- Most comments
Thank you for your help.
However, after I ran the command:
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
I got another error:
Error saving credentials: error storing credentials - err: exit status 1, out: 'The stub received bad data.'
In addition, if I create a private ECR, I can log in to it.
answered a year ago
It looks like you're encountering an authentication issue with Amazon ECR Public. The 403 Forbidden error typically indicates a permissions problem. Here are a few things to check:
- When authenticating to a public registry, you need to use the
ecr-publiccommand and always authenticate to theus-east-1region. Try using this command instead:
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
- If you've previously authenticated and your token has expired, you might need to log out first and then try again:
docker logout public.ecr.aws
Then run the authentication command again.
- Verify that your AWS credentials are properly configured and that you have the necessary permissions to access ECR Public. You can check your current AWS configuration with:
aws configure list
- Make sure you're using the latest version of the AWS CLI, as older versions might not support all the required commands for ECR Public.
If you're using PowerShell (as your command suggests), ensure you're using the correct syntax for the AWS CLI commands in that environment.
Sources
Registry authentication in Amazon ECR public - Amazon ECR Public
Amazon ECR Public troubleshooting - Amazon ECR Public
Cloud Quest Solutions Architect | AWS re:Post
answered a year ago
Relevant content
asked 3 years ago
asked 2 years ago
asked a year ago

I found the below thread can help. https://repost.aws/questions/QUKqrdl3lfR9ON8KnSP6FbzQ/getting-error-while-pushing-images-to-public-ecr