问题描述

最近开始使用 WSL2 + Docker Desktop (4.7.1),有段时间用雷电模拟器玩手游(和 Docker 冲突),现在又要用 Docker,干脆把模拟器卸载了,但 Docker 仍然不可用。

每次打开都是 Docker Desktop stopped,并弹窗报错:

1
error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.

问题解决

经过以下步骤解决,不过也可能只需要执行部分操作。

  1. 重置网络编程接口

    1
    netsh winsock reset
  2. 使用 cmd 切换 Linux 或 Windows 容器

    1
    "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon
  3. 关闭再打开 “适用于 Linux 的 Windows 子系统”

    需要重启

  4. 重装 Ubuntu

    在应用商店里操作即可

  5. 重装 Docker Desktop

    经过上面的一系列折腾发现不弹窗报错,但仍然是停止的状态。重装 Docker Desktop 之后可以用了……

参阅