Skip to content

Commit

Permalink
Fix network discovery error in latest docker version
Browse files Browse the repository at this point in the history
  • Loading branch information
mesudip committed Sep 26, 2024
1 parent c7d6ffb commit 29f2b48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nginx_proxy/pre_processors/virtual_host_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,19 @@ def host_generator(container: DockerContainer, service_id: str = None, known_net
for name, detail in network_settings["Networks"].items():
c.add_network(detail["NetworkID"])
# fix for https://trello.com/c/js37t4ld
if detail["Aliases"] is not None:
if detail["Aliases"] is not None: # we might use alias
if detail["NetworkID"] in known_networks and unknown:
alias = detail["Aliases"][len(detail["Aliases"]) - 1]
ip_address = detail["IPAddress"]
network = name
if ip_address:
break
elif detail['NetworkID']:
ip_address = detail["IPAddress"]
if ip_address:
break
else:
raise UnreachableNetwork()
raise UnreachableNetwork(c.networks)

for host_config in static_hosts:
host, location, container_data, extras = _parse_host_entry(host_config)
Expand Down

0 comments on commit 29f2b48

Please sign in to comment.