两个或多个docker容器之间通过名字相互访问

参考 两个或多个docker容器之间通过名字相互访问

需要公用一个自定义网络

  • 官方特意解释了这两个网卡的区别

User-defined bridges provide automatic DNS resolution between containers.
Containers on the default bridge network can only access each other by IP addresses, unless you use the --link option, which is considered legacy. On a user-defined bridge network, containers can resolve each other by name or alias.

posted on 2023-08-09 10:41  JentZhang  阅读(101)  评论(0编辑  收藏  举报