Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Linking an appserver docker container and a database container on coreos cluster




I am having a cluster of coreos machines. I am running the database on a container in one of the hosts and I am running the appserver on another container in a different host. Since the two containers are not on the same host, I can't really use the 'docker link' command to link these containers together so I wonder what's the best practice to actually inform the webserver about the ip address of the database server.

like image 827
Keeto Avatar asked Oct 21 '22 05:10


1 Answers

This sounds like a good candidate for the ambassador pattern. In a few words: the idea is to create local ambassador containers to link with, and leave them with the responsibility to create the "remote links" with the other hosts. In the end, the goal is to avoid explicitly knowing about the remote hosts from within your application containers.

Here are some resources on this topic:

  • Cross-Host linking using Ambassador Containers
  • progrium/ambassadord: a recently contributed generic implementation of the ambassador pattern
like image 89
icecrime Avatar answered Oct 23 '22 03:10