LoginSignup
0
0

More than 1 year has passed since last update.

Windows11 + WSL2 + Docker - Dockerイメージのビルドエラー

Last updated at Posted at 2022-09-03

概要

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: ``

解決にあたって実行したこと

  1. Docker Desktopを起動する
  2. Settingsを開く
  3. Docker Engineを開く
  4. Daemon configuration fileを下記のように書き換える
  5. [Apply&Restart]をクリックする
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
-    "buildkit": true
+    "buildkit": false
  }
}

参考情報

Daemon configuration file - Feature Options:buildkit

0
0
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
0
0