- Newest
- Most votes
- Most comments
Hello.
I suspect that valid credentials are not set as described in the documentation below.
https://docs.aws.amazon.com/AmazonECR/latest/userguide/common-errors.html#cannot-perform-interactive-login
Can you confirm that the authentication information is obtained from the access key, secret access key, or IAM role using the command below?
aws configure list
In the case of an environment prepared on the Cloud Quest side, there may be a problem on the Cloud Quest side, so contacting the AWS training team from the URL below may resolve the issue.
https://support.aws.amazon.com/#/contacts/aws-training
The issue you're experiencing is likely related to the way the command is being executed in a non-interactive environment. The error message suggesting it's not a TTY device indicates that the command is being run in a context where there's no terminal attached.
To resolve this, you can try the following approach:
1. Split the command into two separate steps:
First, retrieve the ECR login password:
ECR_PASSWORD=$(aws ecr get-login-password --region ${region})
Then, use the password to log in:
echo $ECR_PASSWORD | docker login --username AWS --password-stdin ${fullname}
2. If you're running this in a script or automated environment, make sure you're using the `-e` flag with echo to interpret backslashes correctly.
3. Ensure that you have the necessary permissions to access ECR and that your AWS CLI is configured correctly with the appropriate credentials.
4. Double-check that the ${region} and ${fullname} variables are correctly set and contain the expected values.
5. If you're still encountering issues, you may need to check if Docker is installed and running properly on your system.
By separating the commands and using a variable to store the password, you can avoid potential issues with piping directly into the docker login command. This approach should help bypass the TTY device error and allow you to successfully authenticate with Amazon ECR.
Sources
Failure during custom container creation - AWS SimSpace Weaver
Failure during custom container creation - AWS SimSpace Weaver
Login Issue with Docker to ECR in eu-south-2 Region | AWS re:Post
Relevant content
- AWS OFFICIALUpdated 4 years ago

Above suggestions did not work either.