我正在尝试在 Windows 机器上使用 Docker,并且遇到了所有可能出现的问题。我最新的一个是这样的:我的机器正在运行,但我似乎无法使用 docker 命令与之交互。如果我运行一个非常标准的命令,例如:
docker ps
我收到这样的错误消息:
An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v
1.23/containers/json: open //./pipe/docker_engine: The system cannot find the file specified.
所以显然有些路径都搞砸了。有谁知道这是哪条路以及如何解决这个问题?
原文由 jimmy 发布,翻译遵循 CC BY-SA 4.0 许可协议
编辑(2021)-此答案适用于旧的 Docker Toolbox,而不是 Docker Desktop。
运行
docker ps
并接收时:需要设置以下环境属性:
This is assuming the
%USERPROFILE%\.docker\machine\machines\default
is default path where thecert.pem
,key.pem
,ca-key.pem
, andca.pem
files是;虚拟机名称(由docker-machine create
创建)是default
和 Virtual Box DHCP 服务器的下限(位于 VirtualBox->File->Preferences->Network->Host-only Networks- >将鼠标悬停在 VirtualBox Host-Only Ethernet Adapter 上)是 192.168.99.100 并且没有其他 VM 在 VirtualBox 中运行。