-
Notifications
You must be signed in to change notification settings - Fork 30
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
docker-compose - The domain name was not added to hosts file #32
Comments
I confirm it is an issue for docker-compose v2 |
If I remember well, the problem is that with v2, a container has 1 IP by network and can be in several networks. But we can only register 1 IP by domain name. Nevertheless, It should be possible to extend domain name declaration, or to use the domain name when the container is connected to only 1 network. |
Yes please fiix this. |
any news on this? imho with v2 and v3 this is badly needed |
I experimented a bit for my local dev environment and came to the following solution: Synchronizer.php: if (isset($container['Config']['Labels']['tld.mycompany.docker-hostmanager.network.' . $networkName . '.vhost'])) {
$hosts[] = $container['Config']['Labels']['tld.mycompany.docker-hostmanager.network.' . $networkName . '.vhost'];
} and in docker-compose.yml: services:
web:
- tld.mycompany.docker-hostmanager.network.${COMPOSE_PROJECT_NAME}_default.vhost=my-virtual-domain.tld This way I can match my hosts entry to specific networks (or in this case the default network). I won't do a pull request though as it compromises your DOMAIN_NAME compatibility requirements and follows a slightly different approach for configuring. However I want to leave it here as an idea on how this could be resolved |
This feature would be really appreciated :) |
Hey guys, any news about this ?
If i try to use the version 2 or 3, does not work:
|
Hi @felipemarques We are discussing about this in #34 Also, please read https://github.com/iamluc/docker-hostmanager/pull/39/files |
any news? |
The domain name was not added to hosts file
I'm using docker-compose syntax version 2.
but /etc/hosts file looks like
The text was updated successfully, but these errors were encountered: