为什么Docker无法在Windows 10 Home中检测到WSL 2发行版?

问题描述

我已经按照官方网站上的instruction在WSL 2上使用docker,并且我已经安装了适用于WSL 2发行版的Ubuntu 18.04。我以为docker可以自动检测我的发行版,因此我可以选择要在docker桌面上使用的发行版。我一直在搜索此问题,但仍未找到解决方案。请帮助,谢谢。

这是WSL集成页面,我将ubuntu 18.04设置为认设置,但还是没有运气。

Docker WSL Integration page

这是我拥有的wsl 2发行版的列表

List WSL 2 distro that I have

这是我的docker版本,它是最新版本。

Docker version

因此,它无法访问docker容器

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows,the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

解决方法

我相信这是因为Windows的公共版本Docker Desktop尚不支持向后移植的WSL 2支持。不过Edge / beta版本可以。