skip to Main Content

I am trying to push one docker image to my AWS ECR, but i am getting this error during login

Command I used:

aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/xxxxxx

Error

failed to get console mode for stdin: The handle is invalid.
Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `The stub received bad data.

2

Answers


  1. Split the piped command up into it’s separate commands:

    First run aws ecr-public get-login-password --region us-east-1 and see the password it outputs.

    Then run the second command, but pass it the password as an argument: docker login --username AWS --password <password-output-from-previous-command> public.ecr.aws/xxxxxx

    This will help you isolate the error you are encountering, and possibly get completely past it.


    If you can, I highly recommend using AWS ECR Credentials Helper instead.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search