以管理员权限运行cmd
报错:
docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create: 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.
解决方法来自:[docker][win10]安装的坑 - 简书 (jianshu.com)
解决方法:
打开
C:\Program Files\Docker\Docker
运行DockerCli.exe -SwitchDaemon
此时会弹出docker开始运行的提示
docker desktop的图标也由红色变为白色,启动成功
docker ps正常
注意
因为是要启动虚拟机里的docker,需要注意两点,第一点是内存分配,往大了给,我分配了8G,第二点是vm的虚拟化引擎,docker相当于虚拟机里的虚拟机,所以需要开启虚拟化引擎