Docker – Configuring “auth” and “credsStore” for different Docker registry

amazon-ecrdockerdocker-registry

I'm trying to configure Docker for two different registries. (One ECR and docker.io) I need to configure ECR one with ecr-login and docker.io with simple auth but I'm failing to configure these at the same time. It gives the following error:

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

Here is my ~/.docker/config.json

{
    "auths": {
            "https://index.docker.io/v1/": {
                    "auth": "BASE64-STRING"
            }
    },
    "credsStore": "ecr-login"
}

Why is Docker trying to use credsStore when auth is already available?

Best Answer

Since docker 1.13.0 you can use the new credHelper format instead. I came here from Google having the exact same problem with credStore so thought I would add this for other to find.

Example:

$ cat ~/.docker/config.json 
{
        "auths": {
                "ghcr.io": {
                        "auth": "xxx"
                }
        },
        "credHelpers": {
                "xxx1.dkr.ecr.yyy.amazonaws.com": "ecr-login",
                "xxx2.dkr.ecr.yyy.amazonaws.com": "ecr-login"
        }
}