https://www.docker.com/products/docker-desktop/ 下载安装 Docker Desktop

在 Win 10 中开启 WSL2 并安装 Ubuntu

在 Docker Desktop 设置中开启 Use the WSL 2 based engine

在 Resources - WSL integration 中打开 Ubuntu 前的开关。

现在就可以愉快的在 WSL2 中使用 Docker Desktop 了。

WSL2 Cannot connect to the Docker daemon

当你在 WSL2 中尝试运行 docker 相关的服务却遇到报错 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

并且查了各种各样的资料,尝试了各种各样的方法都没有用时,尝试一下下面的方法。

很简单只要在 Resources - WSL integration 中打开 Ubuntu 前的开关。

就好了...

让我研究了整整一天...

最后更新于 2023-09-07