Docker 无法在网络上创建终结点nat:hnsCall在Win32中失败:进程无法访问该文件
我正在尝试运行以下docker命令(最新的Win10 Fall 2018更新,最新的docker版本2.0): 但它失败了,错误如下: 来自守护程序的错误响应:未能创建终结点 网络nat:hnsCall上的Unrufled_wozniak在Win32中失败:进程失败 无法访问该文件,因为其他进程正在使用该文件。 (0x20) 我尝试了以下方法:Docker 无法在网络上创建终结点nat:hnsCall在Win32中失败:进程无法访问该文件,docker,dockerfile,Docker,Dockerfile,我正在尝试运行以下docker命令(最新的Win10 Fall 2018更新,最新的docker版本2.0): 但它失败了,错误如下: 来自守护程序的错误响应:未能创建终结点 网络nat:hnsCall上的Unrufled_wozniak在Win32中失败:进程失败 无法访问该文件,因为其他进程正在使用该文件。 (0x20) 我尝试了以下方法: -p 1434:1433 重新启动守护进程 docker系统修剪-a 重新启动机器 重新启动HNS服务 重新安装docker 从Windows禁用容
-p 1434:1433
- 重新启动守护进程
docker系统修剪-a
- 重新启动机器
- 重新启动HNS服务
- 重新安装docker
- 从Windows禁用容器和Hyper-V功能
什么都没用。有什么建议吗?我在尝试使用Docker运行PostgreSQL时遇到了同样的问题。问题是港口已经被占用了!这是因为我已经让PostgreSQL在我的操作系统中作为普通数据库运行 我的修复方法是在任务管理器(在“服务”下)中找到
postgresql-x64-10
服务并停止该服务
这个解决方案可能听起来很明显,但我想我还是要提一下,因为我遇到了相同的错误,但是在端口1433上停止本地计算机上运行的SQL Server服务不是一个选项,所以我只是将另一个端口映射到容器。我将端口映射参数替换为以下参数:
-p 1434:1433
这将把本地机器的端口1434映射到容器的端口1433。如果本地计算机的端口1434也在使用中,则必须找到一个可用的端口
一旦你准备好了,如果你想进入SSM,你只需要告诉它使用逗号通过端口1434连接:localhost,1434
不确定这是否明智,但我检查了该端口未与另一个应用程序一起使用,仍然得到了错误 这已经为我解决了好几次这个问题。在管理PowerShell控制台中运行以下操作:
Stop-Service docker
Stop-service hns
Start-service hns
Start-Service docker
docker network prune
部分来源于。如果您在docker with linux容器中,并且有一个挂起的容器使用windows容器中的端口,则在windows中会发生这种情况。 尝试将容器切换到不同的操作系统并停止容器进程。
这对我很有用。在windows上检查端口侦听器: PS:>获取NetTCPConnection | findstr 1433 就我而言: 找到ID=12240的进程并杀死它们(com.docker.backend)
之后我的新端口重定向工作得很好 似乎Linux和Windows的错误消息之间存在差异 命令:
docker run -d -p 80:80 my_image
Linux的错误消息:
docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
docker: Error response from daemon: failed to create endpoint admiring_matsumoto on network nat: failed during hnsCallRawResponse: hnsCall failed in Win32: The process cannot access the file because it is being used by another process. (0x20).
Windows的错误消息:
docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
docker: Error response from daemon: failed to create endpoint admiring_matsumoto on network nat: failed during hnsCallRawResponse: hnsCall failed in Win32: The process cannot access the file because it is being used by another process. (0x20).
将命令更改为
docker run -d -p 81:80
这两种方法都有效
然后,我可以看到,在我的情况下,有一个Windows Defender崩溃服务(应该停止)“保留”端口80,我可以再次使用端口80。我也检查了,我没有启用快速启动选项。这可能对你有帮助吗?没有,我没有防病毒软件。我已经弄明白了,我已经停止了联想的Windows服务,它开始工作了。