3

I use this command to get AWS ECR login token

aws ecr get-login --no-include-email --region ap-southeast-1

After that i run docker login using the output from aws command

sudo docker login -u AWS -p eyJwYX****** https://****8010.dkr.ecr.ap-southeast-1.amazonaws.com

But the result is

Error saving credentials: error storing credentials - err: exec: "docker-credential-pass": executable file not found in $PATH, out: ``

I really don't have any idea how to fix this error i try search everywhere but still no luck

3
  • why you are trying to log in by this way? while you just need to execute token that return by AWS and you can do push pull what ever with ECS in that session
    – Adiii
    Commented Sep 5, 2018 at 12:42
  • I already try that, but when i try to push, it shows error no basic auth credentials Commented Sep 6, 2018 at 2:24
  • before pushing run aws configure and set your secret key
    – Adiii
    Commented Sep 6, 2018 at 5:27

1 Answer 1

5

Try the following steps to fix your docker-credential-pass:

  1. Install docker-credential-pass

    wget https://github.com/docker/docker-credential-helpers/releases/download/v0.6.0/docker-credential-pass-v0.6.0-amd64.tar.gz 
    tar -xf docker-credential-pass-v0.6.0-amd64.tar.gz
    chmod +x docker-credential-pass
    sudo mv docker-credential-pass /usr/local/bin/
    
  2. Setup pass and gpg

    sudo apt-get update
    sudo apt-get install -y pass gpg
    gpg2 --gen-key
    pass init "<PASTE THE GPG-ID>"
    pass insert docker-credential-helpers/docker-pass-initialized-check
    (Set it as "pass")
    pass show docker-credential-helpers/docker-pass-initialized-check
    docker-credential-pass list
    (You should not see "pass store is uninitialized")
    
  3. Add the credsStore line to your ~/.docker/config.json

    {
        "auths": {
            **SKIPPED**
        },
        "credsStore": "pass"
    }
    

    Then you should be able to login.

3
  • Not working it still show some error Error saving credentials: error storing credentials - err: exit status 1, out: 'pass store is uninitialized' Commented Sep 6, 2018 at 6:29
  • Ok so now we made progress, docker-credential-pass is installed properly. But the pass store is not configured properly let. I updated the steps, can you try again? Commented Sep 6, 2018 at 6:37
  • In my case, step gpg2 --gen-key was hanging. Had to follow the following steps (as found here: serverfault.com/questions/471412/…) to get out of it: Open a ssh session sudo apt-get install rng-tools In another SSH window open gpg --gen--key Go back to your first SSH session and run sudo rngd -r /dev/urandom Let this run till gpg generates your keys! Then you can kill rngd sudo kill -9 $(pidof rngd) Commented Mar 19, 2020 at 17:51

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