我有时在我的 WSL2 安装(Windows 2004)上遇到 Docker 问题:
$ docker info
Client:
Debug Mode: false
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?
errors pretty printing info
当然我有 unset DOCKER_HOST
。
然而 Docker 守护进程在 Windows 上运行:
$ tasklist.exe | grep docker
com.docker.service 7016 Services 0 46'884 K
com.docker.backend.exe 9904 Console 1 18'456 K
docker-mutagen.exe 15108 Console 1 8'448 K
com.docker.proxy.exe 21368 Console 1 17'960 K
我的 Ubuntu 发行版正在运行 WSL:
$ wsl.exe -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
docker-desktop Running 2
docker-desktop-data Running 2
$ docker --version
Docker version 19.03.8, build afacb8b7f0
奇怪的是 Docker 说我没有任何 WSL 2 发行版: