64

I got this error during docker build:

 => ERROR [internal] load metadata for docker.io/library/ubuntu:18.04                                                                                                                                                                   2.1s
------
 > [internal] load metadata for docker.io/library/ubuntu:18.04:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exec: "docker-credential-desktop.exe": executable file not found in $PATH, out: ``
Makefile:26: recipe for target 'build-local' failed
make: *** [build-local] Error 1
Taylor D. Edmiston
  • 12,088
  • 6
  • 56
  • 76
Deepak Bhavsar
  • 3,754
  • 2
  • 13
  • 21

7 Answers7

240

This discussion solved my error:
https://forums.docker.com/t/docker-credential-desktop-exe-executable-file-not-found-in-path-using-wsl2/100225

Delete the line with credsStore from ~/.docker/config.json.

Or rename credsStore to credStore

Deepak Bhavsar
  • 3,754
  • 2
  • 13
  • 21
47
  1. Just goto config sudo vi ~/.docker/config.json
  2. rename credsStore to credStore and save. This actually fixed mine (arch).
Aswin Kumar
  • 591
  • 4
  • 3
10

For me this happened when my org had to switch from docker desktop to colima, so here's detail from owner of colima: https://github.com/abiosoft/colima/issues/52#issuecomment-956037291

───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: ~/.docker/config.json
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ {
   2   │     "credsStore": "desktop"
   3   │ }
───────┴─────────────────────────────────────────────────────────────────

You can delete that line and it should work fine.

Black Mamba
  • 13,632
  • 6
  • 82
  • 105
6

Short answer: Delete the line with credStore from ~/.docker/config.json.

Long explanation:

The property credsStore specifies an external binary to serve as the default credential store. When this property is set, docker login will attempt to store credentials in the binary specified by docker-credential-<value> which is visible on $PATH. If this property is not set, credentials will be stored in the auths property of the config.

Read more about it https://docs.docker.com/engine/reference/commandline/cli/#credential-store-options.

Credits to @Javier Buzzi, vote up his comment as well.

valk
  • 9,363
  • 12
  • 59
  • 79
4

today installed and removed docker desktop which is destroyed docker engine, right answer already given:

Delete the line with credsStore from ~/.docker/config.json

Armen Arzumanyan
  • 1,939
  • 3
  • 30
  • 56
4

for arch linux edit the ~.docker/config.json file and paste this code

{
    "auths": {},
    "credStore": "desktop",
    "currentContext": "default"
}


basically change credsStore to credStore

Oloja M
  • 63
  • 5
1

In my case, this file docker-credential-desktop was not found because I was running only docker-engine.

To get this file, I had to install the docker-desktop user interface app, and from the docker-desktop, I logged in to my docker hub account. That's how it worked for me.