This question is different from "How to get the IP address of the docker host from inside a docker container" due to the fact that the IP address of the docker host could be the public IP or the private IP in the network which may or may not be reachable from within the docker container (I mean public IP if hosted at AWS or something). 此问题与“如何从Docker容器内部获取Docker主机的IP地址”不同,这是因为Docker主机的IP地址可以是网络中的公共IP或私有IP,这可能是也可能是无法从docker容器中访问(我的意思是公共IP,如果托管在AWS或其他地方)。 Even if you have the IP address of the docker host it does not mean you can connect to docker host from within the container given that IP address as your Docker network may be overlay, host, bridge, macvlan, none etc which restricts the reachability of that IP address. 即使您具有Docker主机的IP地址,也并不意味着您可以从容器内部连接到Docker主机,因为IP地址可能会覆盖您的Docker网络,主机,网桥,macvlan等,从而限制Docker的可达性该IP地址。
java容器读取本地_如何从Docker容器内部连接到计算机的本地主机?
最新推荐文章于 2023-06-20 10:44:59 发布