Diagathe Josué
Diagathe Josué

Reputation: 12066

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

I'm working on Docker container and I find it strange the default network prevent from communicate between container using the name, thanks for any hint

Upvotes: 0

Views: 87

Answers (1)

zeynel
zeynel

Reputation: 953

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.

Upvotes: 1

Related Questions