-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Don't set the hostname to the service name with networking. #2334
Conversation
Signed-off-by: Daniel Nephin <[email protected]>
LGTM |
thanks @dnephin |
@abronan you might want to use this next week. |
Indeed, LGTM. |
LGTM |
Don't set the hostname to the service name with networking.
What if I'd like to have quite opposite? Set hostname to full service name? E.g. test_myapp_1 instead of myapp only? The reason is following: Previously (Docker 1.8.x), mistakenly using "experimental" /etc/hosts mapping, I could easily connect my container IP with my container name (because it was listed together with the rest of the services running on default subnet) and use it as filter for list of services gathered from Consul. Now my container could be only uid (default Docker /etc/hosts mapping) or service name (generated by Docker-compose) where neither of it helps discovering my real container name (test_myapp_1) published by Registrator to Consul. Any ideas? Could it be optional? |
Does it need to be the container_name? Could it be the unique container id, which you can get from |
That's the trick - (gliderlabs) Registrator registers IP (default=server/host), container_name, published ports. There's no way (please correct me if I'm wrong) how to force it to register container id (as tag for example). Previously, I used container name "experimentally" added to /etc/hosts (registered by Registrator in Consul by default) to filter running services on that specific host and get dynamically assigned port as result, then export it as Java variable and start Tomcat.
container_ip=172.17.42.3
/etc/hosts example now:
|
Ok, this sounds a lot like #1503, let's continue the discussion there |
Fixes #2327
Since it's not being used for anything, I think we can undo this part of the networking experiment. When we get alias support there should be some other mechanism we can use to set the aliases.
cc @aanand @vieux