How to link Docker services across hosts?

前端 未结 8 1403
南笙
南笙 2021-01-29 17:51

Docker allows servers from multiple containers to connect to each other via links and service discovery. However, from what I can see this service discovery is host-local. I wou

相关标签:
8条回答
  • 2021-01-29 18:44

    As mentioned above, Weave is definitely a viable solution to link Docker containers across the hosts. Based on my own experience with it, it is fairly straightfoward to set it up. It is now also has DNS service which you can address container's by its DNS names.

    On the other hand, there is CoreOS's Flannel and Juniper's Opencontrail for wiring the containers across the hosts.

    0 讨论(0)
  • 2021-01-29 18:44

    Seems like docker swarm 1.14 allows you to:

    • assing hostname to container, using --hostname tag, but i haven't been able to make it work, containers are not able to ping each other by assigned hostnames.

    • assigning services to machine using --constraint 'node.hostname == <host>'

    0 讨论(0)
提交回复
热议问题