Docker service discovery does not work with default bridge

落花浮王杯 提交于 2019-12-05 21:14:05

Containers on the default bridge need to be explicitly linked, which is considered legacy/deprecated behaviour.

Warning: The --link flag is a deprecated legacy feature of Docker. It may eventually be removed. Unless you absolutely need to continue using it, we recommend that you use user-defined networks to facilitate communication between two containers instead of using --link. One feature that user-defined networks do not support that you can do with --link is sharing environmental variables between containers. However, you can use other mechanisms such as volumes to share environment variables between containers in a more controlled way.

User defined networks should be used instead, as you have demonstrated.

DNS lookup for default bridge and user-defined network works differently.

Refer to this: https://docs.docker.com/engine/userguide/networking/configure-dns/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!