-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow /etc/hosts to reflect all containers on host, regardless of links #7261
Comments
The With Hope my description is clear :) |
This could be an alternative to using links. Links are fragile and require restarting the whole chain of linked containers. |
There is an alternative to using links, and that is publishing the port with For example, if you were to Provided you can access localhost from DNS, you can then access each container within each container using your localhost as a bridge. |
If, for example, you want to run 5 Redis containers to support 5 different applications, the only thing the applications care about is being able to talk to Redis. There's additional management overhead to expose each of those 5 Redis ports via the host, especially for a service that -- in this case -- should not be publicly exposed. Even if you bind those ports only to the bridge interface, you still have to deal with potential port conflicts. If instead each Redis container gets a hostname that can be resolved by other containers -- Is this a replacement for ports or links? No. Is this an alternative that could be provided by Docker for certain use cases? Yes. Can this be implemented outside of the Docker daemon? Probably, as long as there's no weirdness with mounting your own |
So I'm understanding that what you're looking for is essentially DDNS for containers. This is getting over my head, so I'm going to watch this one from the sidelines from now on. |
This could effectively replace crosbymichael/skydock. It would accomplish the same thing, but with fewer moving parts. |
Alright, thanks for posting that, I'm understanding what you're looking for now. Definitely get what you mean about the fewer moving parts thing. Skydock seems to be a choke-point in the sense that if it fails, the system fails (because your DNS infrastructure is effectively gone) I do see an issue with scalability. Let's say you have 10000 containers running...each time an "event" occurs (like a container is stopped or started), it would need to update every other container's /etc/hosts right? |
On Jul 27, 2014, at 11:54 PM, jlmitch5 notifications@github.com wrote:
Or it could update a single hosts file shared by all containers. |
-1, this is what links are specifically for. Also gh#7092 updates /etc/hosts automatically when linked containers are restarted, but it was closed pending some other changes. This will come back. |
A feature that would help greatly in this case is the ability to swap a linked container without breaking the link. |
If
/etc/hosts
were updated within each container to reflect the current list of running containers, it would be possible for containers to interact via hostnames without having to resort to links.The text was updated successfully, but these errors were encountered: