I have an Amazon ECR Public repository which is created in the ap-southeast-2
region. I tried to log in to the ecr-public
with the following command.
aws ecr-public get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin public.ecr.aws/<default_alias>
But I'm getting the following error,
Could not connect to the endpoint URL: "https://api.ecr-public.ap-southeast-2.amazonaws.com/"
Error: Cannot perform an interactive login from a non TTY device
Why I'm getting this error?
I've configured the AWS credentials via CLI and I could log in to the ecr
private repositories in the same region using the following command.
aws ecr get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin <accound_id>.dkr.ecr.ap-southeast-2.amazonaws.com
Didn't get any errors.
WARNING! Your password will be stored unencrypted in /home/wasdkiller/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
I tried most of the solutions mentioned in the following articles but couldn't solve my problem.
The Amazon ECR Public repositories are not region-specific, you could see the same Amazon ECR Public repositories in many other regions, but public repositories only you can see like this. The Amazon ECR or in other words, private repositories are region-specific, available only within your region.
But if you are going to deal with the
ecr-public
service, you must work with theus-east-1
region. Yes, I told you earlier, the Amazon ECR Public repositories are not region-specific. But theecr-public
command and their subcommands are region-specific. Here is what they mentioned in the Quick start: Publishing to Amazon ECR Public using the AWS CLI getting started article,I hope this will help you to solve your problem, just change your region to
us-east-1
.