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.