I asked this question at docker's IRC over the weekend but had to head off before I'd thought through the answers:
If I have a number of applications running in containers (let's, for the moment, assume they're all running on the same physical hardware, but that needn't be the case) and I want each of them to be able to find each other automatically.
Using some sort of registry (eg. etcd or DNS-SD/Bonjour) you could announce your service and any pertinent details and have the other applications find out about them and route traffic accordingly.
The problem here is that while an application can know which hostname/port it is serving on within a container, this needn't be the port or address it's accessible from. There are two bits of information which need to be joined up:
How would you recommend I get this information across the container barrier?
Any thoughts or guidance as to how I should solve this problem?
I think perhaps the approach to perform the registration of the service after launching the container. Other containers can then perform a registry lookup to discover these services.
The maestro project gives an example of how the containers are configured externally and then launched to setup a cooperating network of containers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With