LoginSignup
60
19

More than 1 year has passed since last update.

WSL2でDocker buildをすると止まる問題("docker-credential-desktop.exe": executable file not found in $PATH, out: ``)

Last updated at Posted at 2021-02-24

はじめに

Docker build -f ./Dockerfile -t ~~ . をしていて,エラーで止まって色々ググった結果を載せておきます.
初心者なりの試行錯誤なので的外れ感ありますが,優しくみてください.
やるまえに参考文献の方をみてからやることをお勧めします.

環境

  • cpu : Intel Core i9 9900k
  • gpu : Nvidia RTX2080 Super
  • ram : 32GB
  • Docker Desktop使用

エラー文

Ubuntu18.04のビルドをしたかった.

~~~@MyComputer:~/dock$ docker build -f ./Dockerfile -t ubuntu .
[+] Building 0.8s (3/3) FINISHED                                                                                                                                                                                  
 => [internal] load build definition from Dockerfile                                                                                                                                                         0.0s
 => => transferring dockerfile: 1.53kB                                                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                                                            0.0s
 => => transferring context: 2B                                                                                                                                                                              0.0s
 => ERROR [internal] load metadata for docker.io/library/ubuntu:18.04                                                                                                                                        0.8s
------
 > [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: ``

なにこれ.

解決

.dockerのディレクトリにconfig.jsonがあると思います.

~~@MyComputer:~/.docker$ ls
config.json  contexts  run  scan

ありましたね.
config.jsonの中身をみると,

{
  "credsStore": "desktop.exe"
}

とだけあると思います.
サイトをみる感じだと,

{
  "credStore": "desktop.exe"
}

credsStoreからcredStoreへsを消すと動くらしい.

~~@MyComputer:~/dock$ docker build -f ./Dockerfile -t ubuntu .
[+] Building 148.7s (25/25) FINISHED     

動いちゃった.
なんでこうやると動くんでしょうか.
また,何かあったら追加しておきます.

参考文献

60
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
60
19