From 7470b3bb15fc21393933e75b905f06f0f953700b Mon Sep 17 00:00:00 2001 From: Ralf Eckstein Date: Mon, 6 Jul 2026 14:45:36 +0200 Subject: [PATCH] Docker 29 doesn't have NetworkSettings->IPAddress, use IP address from Networks instead when obtaining hostnames from ENV variables --- src/Synchronizer.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Synchronizer.php b/src/Synchronizer.php index b393ea5..77ebdbb 100644 --- a/src/Synchronizer.php +++ b/src/Synchronizer.php @@ -116,13 +116,6 @@ private function getHostsLines($container) { $lines = []; - // Global - if (!empty($container['NetworkSettings']['IPAddress'])) { - $ip = $container['NetworkSettings']['IPAddress']; - - $lines[$ip] = implode(' ', $this->getContainerHosts($container)); - } - // Networks if (isset($container['NetworkSettings']['Networks']) && is_array($container['NetworkSettings']['Networks'])) { foreach ($container['NetworkSettings']['Networks'] as $networkName => $conf) { @@ -136,6 +129,8 @@ private function getHostsLines($container) $hosts[] = $alias.'.'.$networkName; } + $lines[$ip] = implode(' ', $this->getContainerHosts($container)); + $lines[$ip] = sprintf('%s%s', isset($lines[$ip]) ? $lines[$ip].' ' : '', implode(' ', $hosts)); } }