Score:-1

Error to login ecr docker

lr flag

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
Luka Martins avatar
lr flag
solution found was to apply sudo in front of the docker command
Score:0
ma flag

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.

Luka Martins avatar
lr flag
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?
Score:0
gp flag
Tim

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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.