-
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
simple names in /etc/hosts when using the experimental networking feature #2312
Comments
Nope, the docker/libnetworking support isn't in yet to provided aliases. As soon as it is, we'll be adding support to compose. The only way to do it right now is with the It should be coming in the next release. |
I just created moby/libnetwork#737 |
Follow up question. Using the 1.5.0 release, how is one supposed to use the experiment networking feature without alias'? I have config files for my webapp that tell it that the hostname of the database is "db". I can use the container_name feature but that breaks that ability to startup multiple instances. I just don't get how people are using this feature. Are there any examples in the documentation that could help me? I haven't been able to find any. |
There is one example in #2294, where you can set the project name using |
As part of this, we might want to consider adding aliases that use dashes (or some other character) as well as underscores for each container. That way we could transition away from underscores in hostnames (which is technically invalid). |
This is now done in 1.6.0 (RC1 is out) |
When using the
--x-networking
feature in docker-compose 1.5 (docker-engine 1.9), is it possible to get a "simple name" added to /etc/hosts without knowing the container name beforehand and without using thecontainer_name
directive?For example, the following compose file in a directory called dockercompose might produce the /etc/hosts entries below:
/etc/hosts entries in the auto generated "dockercompose_web_1" container looks like:
I was hoping I would see the following entry as well:
Let's say the image
firstapp
is hardcoded to communicate with a host namedweb2
andsecondapp
is harcoded to communicate with a host namedweb
. Is it possible to get this circular communication working and maintain the ability to startup multiple instances of the overall app?The text was updated successfully, but these errors were encountered: