docker-hostmanager icon indicating copy to clipboard operation
docker-hostmanager copied to clipboard

DOMAIN_NAME environment variable not working

Open guillian77 opened this issue 4 years ago • 1 comments

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

guillian77 avatar Jun 11 '21 11:06 guillian77

Hi,

See https://github.com/iamluc/docker-hostmanager/pull/34. There is a long discussion about this!

iamluc avatar Jun 11 '21 14:06 iamluc