curl 应用程序 ip 时出现此错误
curl (56) Recv 失败:连接被对等方重置 - 当访问 docker 容器时
最佳答案
通过运行做一个小检查:
docker run --network host -d <image>
如果 curl
在此设置下运行良好,请确保:
- 您正确地将主机端口映射到容器的端口:
docker run -p host_port:container_port <image>
- 您的服务应用程序(在容器中运行)正在
localhost
或0.0.0.0
上运行,而不是127.0。 0.1
关于docker - curl (56) 接收失败 : Connection reset by peer - when hitting docker container,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50155033/