2

I am trying to push my Nest.js app to an AWS ECR in a public repo. I created an IAM user and attached AdminstratorAccess policy to it and then generated a private key. When I type the following command in cmd:

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

I get the following error:

Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `The stub received bad data.``

I have AWS CLI installed.

1 Answer 1

0

I hope you have logged in with the IAM user with the AdministratorAccess policy using the aws configure command.

One quick workaround is to modify .docker\config.json file. Remove the following line "credsStore" key so that the docker will use the file system to store tokens:

      "credsStore": "wincred"

Now run your AWS CLI command:

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

And you should get the output like this:

WARNING! Your password will be stored unencrypted in C:\Users\user\.docker\config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

Also, I think that removing C:\Program Files\Docker\Docker\resources\bin\docker-credential-desktop.exe and C:\Program Files\Docker\Docker\resources\bin\docker-credential-wincred.exe might work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.