Skip to content

Forbidden to login ECR Public

0

Hi,

I am a newbie here.

I am facing a problem with using ECR Public.

After I created a repo in the "Public registry", I ran the command:

Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin public.ecr.aws"

I got the error.

Error response from daemon: login attempt to https://public.ecr.aws/v2/ failed with status: 403 Forbidden

Would anyone be able to help me?

Thank you! Terry

asked a year ago560 views

2 Answers
0
Accepted Answer

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

0

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:

  1. When authenticating to a public registry, you need to use the ecr-public command and always authenticate to the us-east-1 region. Try using this command instead:
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
  1. 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.

  1. 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
  1. 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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.