docker / docker-credential-helpers

Programs to keep Docker login credentials safe by storing in platform keystores
MIT License
1.08k stars 170 forks source link

Document use of docker-credential-helpers with Docker Desktop #303

Open gzagatti opened 10 months ago

gzagatti commented 10 months ago

The documentation does not discuss the use of docker-credential-helpers with Docker desktop.

If you follow the instruction from the README file you will only be able to configure credentials for the docker in the CLI which will not be picked up by Docker Desktop.

It turns out that Docker Desktop has its own set of configurations in ~/.docker/desktop/settings.json. Make sure to change the following entry in this file so Docker Desktop picks the right credential method.

{
  "credentialHelper": "docker-credential-secretservice",
}

In my case, I finally got rid of the annoying PGP dialogues in Ubuntu by switching to the OS keyring.

It would be a great idea to have this instructions documented in the README file. It took me a while to find this workaround.

Also, is this the recommended approach to integrate the credential helpers with Docker Desktop?

FlurinArner commented 7 months ago

I faced the same issue as #182 (docker-credential-pass not found) after installing Docker Desktop on Ubuntu 22.04, when attempting docker login $PRIVATE_REGISTRY.

Things I noticed:

What resolved my issue:

  1. Setting ~/.docker/config.json to
    {
        "credsStore": "desktop"
    }
  2. Following the Signing in with Docker Desktop for Linux Guide, to generate the gpg key and initialize pass.
  3. After this, docker login $PRIVATE_REGISTRY worked like a charm.