之前,安裝 Docker 已經可以正常使用了,但是今天突然又不行了,運行
docker ps
命令報錯。
錯誤1: error during connect
詳細報錯信息如下:
C:\Users\zig>docker ps
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.
★ 解決方法,打開命令行 cmd.exe
:
cd "C:\Program Files\Docker\Docker"
DockerCli.exe -SwitchDaemon
原因:
Especially on windows machine when you see the above error after a docker update, try the above commands.
It appears like the Docker Desktop UI may indicate that you are already using Linux Containers, but the update may have messed up that setting.
Running the above commands will set to Linux Containers and there after you can work happily.
翻譯:
特別是在 Windows 系統的機器,當你的 Docker 更新之后會出現上述錯誤,試試上面的命令。
看起來Docker桌面UI可能表明您已經在使用Linux容器,但是更新可能已經弄亂了設置。
運行上述命令將設置為Linux容器,然后您就可以愉快地工作了。
個人經驗:
如何判斷你是正確設置到 Linux 容器呢?答:使用 docker info
命令:
- OStype 應該是 linux
錯誤2:no matching manifest
詳細報錯信息如下:
C:\Program Files\Docker\Docker>docker pull zookeeper:3.5.9
3.5.9: Pulling from library/zookeeper
3.5.9: Pulling from library/zookeeper
no matching manifest for windows/amd64 10.0.17134 in the manifest list entries
這個問題的原因是當前切換到了 windows 容器,而不是 linux 容器。此時用 docker info
可以查看:
解決方案:
再次使用 DockerCli.exe -SwitchDaemon
錯誤3:Error response from daemon
詳細報錯信息如下:
C:\Program Files\Docker\Docker>docker info
Client:
Context: default
Debug Mode: false
Server:
ERROR: Error response from daemon: open \\.\pipe\docker_engine_linux: The system cannot find the file specified.
errors pretty printing info
解決方案:
1、右擊計算機,點擊管理:
2、點擊左側菜單欄中的服務,在右邊找到 Docker Desktop Service, 再點擊重啟動此服務
參考文檔
windows10下安裝docker報錯:error during connect 閱讀