docker-hostmanager
docker-hostmanager copied to clipboard
DOMAIN_NAME environment variable not working
Hi, thanks a lot for your great work.
I am trying to specify custom DNS by using DOMAIN_NAME environment variable but it did not work. I read your code a bit and I have debugging something interresting.
// src/Synchronizer.php:120
// Global
if (!empty($container['NetworkSettings']['IPAddress'])) {
$ip = $container['NetworkSettings']['IPAddress'];
$lines[$ip] = implode(' ', $this->getContainerHosts($container));
}
For me this condition cannot be true because $container['NetworkSettings']['IPAddress'] is null or empty.
I just move $lines[$ip] = implode(' ', $this->getContainerHosts($container)); to line 130 just after $ip declaration and it work great.
I don't know if it's really a bug or this problem come from my setup.
Maybe I have to specify an other thing to make it work ?
Docker version 20.10.6, build 370c289 docker-compose version 1.28.6, build 5db8d86f
Best regards
Hi,
See https://github.com/iamluc/docker-hostmanager/pull/34. There is a long discussion about this!