LoginSignup
4
3

More than 3 years have passed since last update.

WSL2 で Docker Desktop for Windows (Edge) を利用する

Last updated at Posted at 2019-11-05

Docker Desktop WSL 2 backend

以下の手順に従ってインストールできます。
(URI が tech-preview のままですね… そのうち変更されて 404 になると思います)

2.1.7.0 (41536) のスクリーンショット

image.png

WSL 2 Backend

2.1.5.0 以降、 Docker Desktop WSL 2 Tech Preview から WSL 2 backend に変更されました。

ブログポストの案内通り、 Settings - GeneralWSL 2 based engine を有効化しましょう。

This new backend can be enabled in Docker Desktop settings

Settings - Resources - WSL INTEGRATION も必要です

Go to settings and enable ubuntu integration

動作確認

WSL2 で docker login して docker run hello-world できました!

$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 8
  Running: 0
  Paused: 0
  Stopped: 8
 Images: 4
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.84-microsoft-standard
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 6.111GiB
 Name: docker-desktop
 ID: 4GEL:P6ZX:BIPD:ENWN:YOVB:J4BV:LLT6:HZMY:XWKA:H4RA:7SLK:WF4T
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 33
  Goroutines: 50
  System Time: 2019-12-13T02:08:52.770077Z
  EventsListeners: 3
# (以下略)
$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
4
3
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
4
3