docker / docker-credential-helpers

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

docs source about docker-credential-desktop #149

Open lalyos opened 5 years ago

lalyos commented 5 years ago

After a DockerForMac update i've realised, that that the ~/.docker/config.json file is not refering to osxkeychain anymore. Its uses docker-credential-desktop.

Where can i get more info, like docs, source code about this new helper.

cheers, Lajos

imkarrer commented 5 years ago

I just updated to 2.1.0.0 and I received the following while doing a docker login with "securely store docker logins in osxkeychain" preference disabled.

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

Google searches are turning up dry for docker-credential-desktop. Not sure where it is, or my my docker for mac could no longer find it for docker logins after the update to 2.1.0.0

erichartline commented 5 years ago

I ran into the same issue when updating today. I was able to roll back to a previous release for now by going here.

imkarrer commented 5 years ago

I filed docker/for-mac#3774 for tracking purposes since this issue is intended to address the documentation fordocker-credential-desktop

jpknox commented 5 years ago

My colleague found a fix that also worked for me. Go into preferences and tick 'Securely store Docker logins in macOS keychain'.

markverg commented 5 years ago

unfortunately that check is already checked in my case.. If I uncheck and restart it's checked again afterwards..

MisterSpicy commented 5 years ago

Ran into this same issue after upgrading to 2.1, discovering it doesn't work with Sonatype Nexus (https://github.com/docker/compose/issues/6713 it seems).

Downgraded back to 2.0, saw this issue - deleted my ~/.docker folder and restarted - was able to use Docker again! I'm going to wait until 2.2 before I update...

gbiv commented 5 years ago

I hit this running 2.1 and a delete of my ~/.docker directory, then relogin fixed it

RichardBronosky commented 4 years ago

This issue is the only reference that I can find. But, in my case with Docker version 19.03.4, build 9013bf5 I find that docker-credential-desktop exists (as a symlink from /usr/local/bin/docker-credential-desktop -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-desktop) and works. I demo it here https://stackoverflow.com/a/58795217/117471

SamSharaf commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

ArunDhwaj commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

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

I've did as per your suggestion and it is working now.

Thanks :)

MohanRajRavi commented 4 years ago

if its windows, try to change credsStore value to wincred

andreipa commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Thank you. Your solution did the trick!

LunaNYC commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Thank you. Your solution did the trick!

I have the same problem and new to docker. Could not find "~/.docker/config.json" (tried C:\ProgramData\Docker), using windows, how to locate it? Thanks.

curtisgray commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Thank you. Your solution did the trick!

I have the same problem and new to docker. Could not find "~/.docker/config.json" (tried C:\ProgramData\Docker), using windows, how to locate it? Thanks.

ln -s /c/Users/<USER NAME>/.docker/ ~/.docker

OR

ln -s /mnt/c/Users/<USER NAME>/.docker/ ~/.docker

LunaNYC commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Thank you. Your solution did the trick!

I have the same problem and new to docker. Could not find "~/.docker/config.json" (tried C:\ProgramData\Docker), using windows, how to locate it? Thanks.

ln -s /c/Users/<USER NAME>/.docker/ ~/.docker

OR

ln -s /mnt/c/Users/<USER NAME>/.docker/ ~/.docker

Thank you! I got it!

cowlinator commented 4 years ago

Thank you @lalyos for opening this issue about the lack of documentation for docker-credential-desktop.

What is docker-credential-desktop?

Does it store my sensitive secrets in plaintext? Does it sell my information online? Is it malware? Will it automatically start my coffee maker?
Is it even software?

Is it ZA̡͊͠͝LGΌ? H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ.

carlosonunez commented 4 years ago

You can find more information about docker-credential-helper here.

In my case, I was using docker-toolbox to avoid the performance regressions I've seen with Docker for Mac. This does not come with these helpers by default, and the desktop credential helper only comes with Docker for Mac.

I was able to resolve this by:

  1. Downloading the helpers: brew install docker-credential-helper, then
  2. Changing "credsStore" : "desktop", to "credsStore" : "osxkeychain".
cowlinator commented 4 years ago

@carlosonunez , you linked to the readme at the root of this repo. It contains no information about "desktop". There is no file in this repo that has "desktop" in the name. I searched the repo for "desktop", and got We couldn’t find any code matching 'desktop' in docker/docker-credential-helpers.

So, again,

What is docker-credential-desktop?

mrsaeedanwar commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Thanks this works for me.

imkarrer commented 4 years ago

Agreed. I hope people stop posting their workarounds here and in separate issues so that the most current comment sticks to the original issue for missing documentation.

What is docker-credential-desktop?
saifelse commented 4 years ago

I ran sudo opensnoop -n docker-credential-desktop and then docker-credential-desktop list, which surfaced amongst other fd accesses:

  UID    PID COMM          FD PATH
  503  33551 docker-credentia   3 /Users/saif/Library/Keychains/login.keychain-db
  503  33551 docker-credentia   3 /Library/Keychains/System.keychain

Searching "docker" in my keychain surfaced the two credentials that show up in docker-credential-desktop list (and modifying them in the keychain did show up when re-running the command)... so it looks like does not store it in plaintext and in fact does store it on the macOS keychain.

In fact, docker-credential-osxkeychain list surfaces the same set of credentials.... I tried diffing the two binaries but they don't appear to be identical... I wonder if there is some sort of repackaging osxkeychain as desktop as part of "Docker for Mac" (though it is 10x bigger 😮... ) ?

alexryabkov commented 4 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Thank you! It works now!

sparrowt commented 3 years ago

Regarding the original question of what docker-credential-desktop actually is it seems that the situation on Windows is similar to what @saifelse found on Mac - in both cases it appears to function as a wrapper for the OS-specific store helper.

So on Windows the process tree in Procmon shows that it calls out to docker-credential-wincred passing on its arguments: image

The -desktop binary is substantially bigger than the -wincred one (~4x) so who knows what else it does, if anything.

Unfortunately because "Docker Desktop" (previously "Docker for Windows" & "Docker for Mac") is closed-source, there isn't any code at https://github.com/docker/for-win or https://github.com/docker/for-mac/ to enlighten us further...

To request clarification I imagine filing an issue on one of those repos might be the best next step - given that it would appear docker-credential-desktop is built from private code not in this repo.

Dana-Drahler commented 3 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Worked for me! Thanks

dmenne commented 3 years ago

Worked for me too, but is always overwritten on restart. Setting the file to readonly hangs Docker Desktop on startup.

Any solution?

rrehman-hbk commented 2 years ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

This worked for me. Thank you

dmenne commented 2 years ago

This worked for me ... until you restart ...

andrecolza commented 2 years ago

Worked for me too, but is always overwritten on restart. Setting the file to readonly hangs Docker Desktop on startup.

Any solution?

@dmenne Did you found any solution? I have this problem too...

dinicolae commented 1 year ago

I hit this running 2.1 and a delete of my ~/.docker directory, then relogin fixed it

This ruined everything. docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. Can not start docker now. Tried every possible command on the net. I run docker using colima

adonig commented 1 year ago

I ran into this issue probably because I had installed Docker Desktop and recently decided to remove it.

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

Deleting that key/value pair from the config solved it for me. Thanks @SamSharaf for sharing that solution with us.

gelodefaultbrain commented 1 year ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

This works! I think it's because it's trying to login? on the docker account associated with docker desktop? so yeah removing it I think disables it? if I'm not mistaken but yeah awesome. Thanks!

jabrielcjones commented 1 year ago

Edit the file "~/.docker/config.json" and delete the following JSON key/value: "credsStore" : "desktop",

This worked for me. I got the original error after removing Docker Desktop on M1 machine and installing docker, docker-compose, and colima via homebrew

docker run hello-world and docker run -it ubuntu bash ran just fine. Then, I tried to use docker compose to create a container for my Flask app (which worked with the Docker Desktop setup), and I got the original error.

All good now! Thanks!

ajays97 commented 1 year ago

You can find more information about docker-credential-helper here.

In my case, I was using docker-toolbox to avoid the performance regressions I've seen with Docker for Mac. This does not come with these helpers by default, and the desktop credential helper only comes with Docker for Mac.

I was able to resolve this by:

  1. Downloading the helpers: brew install docker-credential-helper, then
  2. Changing "credsStore" : "desktop", to "credsStore" : "osxkeychain".

Ok this seemed to fix it for me. Thanks a lot!

bdbrink commented 1 year ago

This worked for me, was using "credsStore" : "desktop" and that solved the issue originally, but error resurfaced.

  1. Downloading the helpers: brew install docker-credential-helper, then
  2. Changing "credsStore" : "desktop", to "credsStore" : "osxkeychain".
xullul commented 1 year ago

I fix this on MacOS by simply change "credsStore" to "credStore". it's in "~/.docker/config.json" It's been 3 years since I first encounter this problem but I still cannot find explaination yet.

amorta commented 1 year ago

Changing "credsStore" to "credStore" in "~/.docker/config.json" file fixed the issue on macOS (Sonoma 14.0)

prestonhale commented 7 months ago

Changing credsStore to credStore is not the correct fix. It is in fact some -serious- cargo cult nonsense.

credStore is an invalid key so don't bother renaming. Just delete the entire line.

That being said some docker actions will re-add the line so a better fix is needed.