Locally I am trying to push my docker image to AWS ECR repository but I am getting the below mentioned error

700 Views Asked by At

I am trying to push my image from local to AWS ECR , but I get the below error in my terminal

failed to get console mode for stdin: The handle is invalid. Error saving credentials: error storing credentials - err: exit status 1, out: not implemented

There are bunch of suggestions available on stack overflow or on google , but none of them worked for me . I am using windows 11 .

Reproducible steps

  1. installed docker desktop.
  2. locally built an image .
  3. created a repository on aws ECR.
  4. ran aws configure.
  5. Tried this command to push the image

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

2

There are 2 best solutions below

3
datawookie On

Try this:

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

For a public registry on ECR you use us-east-1 region for password.

The principle difference to your original command is that the URI is just public.ecr.aws with no / or anything after.

enter image description here

1
CodeOfLife On

I was able to solve it by removing these from my computer

C:\ProgramFiles\Docker\Docker\resources\bin\docker-credential-desktop.exe C:\ProgramFiles\Docker\Docker\resources\bin\docker-credential-wincred.exe

After that I was able to successfully login (I do see some warning) , but for now it's working . please see the message.

failed to get console mode for stdin: The handle is invalid. WARNING! Your password will be stored unencrypted in C:\Users\Username.docker\config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded