首页 > 解决方案 > 使用 docker 时出错 - 连接期间出错

问题描述

我已经在 Windows 10 操作系统中安装了 docker,现在我只是在运行一些命令但出现错误。我已经完成了 docker 新手。

C:\WINDOWS\system32>docker run dockerinaction/hello_world
docker: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create": open //./pipe/docker_engine: The system cannot find the file specified.
See 'docker run --help'.

版本也出现错误:

C:\WINDOWS\system32>docker version
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/version": open //./pipe/docker_engine: The system cannot find the file specified.
Client:
 Cloud integration: 1.0.17
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.16.4
 Git commit:        f0df350
 Built:             Wed Jun  2 12:00:56 2021
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

在查看Docker 无法在 Windows 上启动docker-machine的帖子后,我尝试运行另一个命令

C:\WINDOWS\system32>docker-machine env --shell cmd default
'docker-machine' is not recognized as an internal or external command,
operable program or batch file.

在查看帖子后,我还尝试了另一个命令 - Docker:连接期间出错

C:\WINDOWS\system32>docker-machine env box
'docker-machine' is not recognized as an internal or external command,
operable program or batch file.

如何修复这些错误?

标签: docker

解决方案


我首先会像错误所说的那样以提升的方式运行 docker。Docker-machine 不起作用,因为它不在您的 PATH 或任何 Windows 等效项上。我没有听说过 docker machine 并且在本地快速检查告诉我这不包含在标准安装中,因此可能需要单独安装

这是 Docker 机器的 GitHub 存储库,但查看它,它只真正用于旧的过去 https://github.com/docker/machine/releases


推荐阅读