解决Docker Desktop运行一直转问题
作者:佛系Java程序员
遇到Docker启动报错、Docker Desktop运行不正常等问题,常见解决方案包括以管理员身份运行CMD,重启Docker服务,恢复Docker Desktop出厂设置,启用Windows功能等,最终通过运行cmd命令"netsh winsock reset"解决问题,但需注意此操作可能导致Docker镜像丢失
Docker Desktop 运行一直转
问题截图
(1)打开cmd,运行docker images报
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.
(2)运行Docker Desktop报错
System.InvalidOperationException: Failed to set version to docker-desktop: exit code: -1
解决方案
(1)以管理员身份运行cmd,先运行cd C:\Program Files\Docker\Docker(docker安装目录),再运行DockerCli.exe -SwitchDaemon(个人尝试没啥用)
(2)运行docker ps(个人尝试也没啥用)
(3)重启docker服务,将docker desktop恢复出厂设置(个人尝试还是没啥用)
(4)cmd运行 dism.exe /online /enable-feature
- /featurename:Microsoft-Windows-Subsystem-Linux /all
- /norestart,然后运行dism.exe /online /enable-feature
- /featurename:VirtualMachinePlatform /all
- /norestart,再将电脑重启(不知道哪看的,但个人尝试好像没啥用)
(5)cmd运行netsh winsock reset(终于解决了,但之前排雷太多导致自己的镜像全没了
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。