更新时间: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.