且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

curl:(7)无法连接到localhost端口8090:连接被拒绝

更新时间:2022-03-08 19:53:52

在Docker容器中, localhost 127.0.0.1 是指容器本身。为了访问使用容器运行dockerd的主机,您必须通过其公共主机名/ IP引用主机,就像是网络上的另一台机器。

Inside a docker container the localhost and 127.0.0.1 refer to the container itself. In order to access the host machine running dockerd with your container you must refer to the host by its public hostname/IP as if it was another machine on the network.