简体   繁体   中英

Why we need custom bridge to communicate with others Dockers container using name? Why the default's bridge cannot do it please?

我正在使用Docker容器,但奇怪的是默认网络阻止使用该名称的容器之间进行通信,谢谢您的提示

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.

From official docker documentation

Technically, there is nothing stopping docker to resolve the container names on default bridge network. I think it is just a decision that is made by docker team to force users to create bridge networks consciously. So that they know what they are doing and securely use it for production.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM