awslabs / amazon-ecr-credential-helper

Automatically gets credentials for Amazon ECR on docker push/docker pull

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS EC2 AMAZON LINUX not implemented

devcaco opened this issue · comments

Hello, I'm running an EC2 with amazon linux and I followed the setup guide but when I try to docker login I get the following error:

Error saving credentials: error storing credentials - err: exit status 1, out: not implemented

Any help would be greatly appreciated.

Thanks

Hi. The problem is in /home/<username>/.docker/config.json file. I suppose you set a credstore to ecr in it.
IDK where I found the solution, but you have to do the following:

  1. (Only if you already have set ecr as a credstore in your .docker/config file). cat /dev/null > ~/.docker/config.json
  2. Login to ECR aws ecr get-login-password --region <aws-region> | docker login --username AWS --password-stdin <account-id>.dkr.ecr.eu-central-1.amazonaws.com
  3. Replace credential store in ~/.docker/config file: cat /dev/null > ~/.docker/config.json && cat << EOF > ~/.docker/config.json { "credsStore": "ecr-login" } EOF
  4. Pull one of the containers from your ECR repo docker pull <account-id>.dkr.ecr.eu-central-1.amazonaws.com:<image>
  5. Enjoy