-1

I'm trying to login ecr with docker to upload the container, but it always returns an error. The cli configuration is ok. I'm following the documentation that aws provides, but still to no avail.

Command login

aws ecr get-login-password \
    --region REGION \
| docker login \
    --username AWS \
    --password-stdin "https://account-ID.dkr.ecr.REGION.amazonaws.com"

Return error

Unable to locate credentials. You can configure credentials by running "aws configure".
Error: Cannot perform an interactive login from a non TTY device
  • ubuntu 22.04
  • aws-cli/2.7.35

2 Answers2

0

Have you tried running the "aws configure" command to set up your credentials? If not, that might be a good place to start. Otherwise, it sounds like you may need to set up an IAM role with the appropriate permissions.

Bot123
  • 1
  • Yes, the .aws settings are done. I'll take a look at the iam permissions. So, what permission should I actually pass on the iam? – Luka Martins Oct 16 '22 at 05:31
0

Give this pattern a shot. The main difference seems to be you have "https:// as the last argument, this one has just the account number.

aws ecr get-login-password --region ap-southeast-2 --profile profilename | docker login --username AWS --password-stdin 123456789.dkr.ecr.ap-southeast-2.amazonaws.com
Tim
  • 31,888
  • 7
  • 52
  • 78