概要
WSL2上でのDockerイメージのビルドエラーをDaemon configuration fileを変更して回避した。
エラーの内容
環境
- Microsoft Windows 11 Pro Build 10.0.22000
- Docker Desktop v4.12.0 - Docker Engine v20.10.17
- WSL2 - Ubuntu-20.04
再現手順
$ docker build
[+] Building 10.7s (2/3)
[+] Building 10.8s (3/3) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 3.30kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/library/ubuntu:22.04 10.8s
------
> [internal] load metadata for docker.io/library/ubuntu:22.04:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 255, out: ``
解決にあたって実行したこと
- Docker Desktopを起動する
- Settingsを開く
- Docker Engineを開く
- Daemon configuration fileを下記のように書き換える
- [Apply&Restart]をクリックする
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
- "buildkit": true
+ "buildkit": false
}
}