常见问题的解决方法
重新启动
重新启动您的 PC 以停止/丢弃从 以前安装的版本。
未凝固的DOCKER_HOST
这DOCKER_HOST
环境变量不需要设置。如果您使用
bash 中,使用命令unset ${!DOCKER_*}
以取消设置。对于其他 shell,
请参阅 shell 的文档。
确保 Docker 正在运行 Web 服务器示例
对于hello-world-nginx
example 和其他 Docker Desktop 必须为
正在运行以访问 Web 服务器http://localhost/
.确保
Docker 鲸fish显示在菜单栏中,您可以在其中运行 Docker 命令
连接到 Docker Desktop Engine 的 shell。否则,您可能会启动 Web 服务器容器,但会得到一个“网页
not available“错误docker
.
如何解决port already allocated
错误
如果您看到类似Bind for 0.0.0.0:8080 failed: port is already allocated
或listen tcp:0.0.0.0:8080: bind: address is already in use
...
这些错误通常是由 Windows 上的一些其他软件使用这些错误的
港口。要发现此软件的身份,请使用resmon.exe
GUI 并单击“网络”,然后单击“侦听端口”或在 PowerShell 中使用netstat -aon | find /i "listening "
发现进程的 PID
当前正在使用端口(PID 是最右侧列中的数字)。决定
是关闭其他进程,还是使用
docker 应用程序。
安装防病毒软件后,Docker Desktop 无法启动
某些防病毒软件可能与 Hyper-V 和 Microsoft 不兼容 Windows 10 版本。冲突 通常发生在 Windows 更新之后,并且 表现为来自 Docker 守护程序的错误响应和 Docker Desktop 启动失败。
要获得临时解决方法,请卸载防病毒软件,或者 探索 Docker Desktop 论坛上建议的其他解决方法。