if the networks is "host", use 127.0.0.1
This commit is contained in:
parent
581f5c1e66
commit
6b5ca1643e
|
|
@ -62,6 +62,9 @@ def get_container_data(dockerClient, container_id):
|
|||
container_hostname = info["Config"]["Hostname"]
|
||||
container_name = info["Name"].strip("/")
|
||||
container_ip = info["NetworkSettings"]["IPAddress"]
|
||||
if not container_ip and info["NetworkSettings"]["Networks"]["host"]:
|
||||
container_ip = "127.0.0.1"
|
||||
|
||||
if info["Config"]["Domainname"]:
|
||||
container_hostname = container_hostname + "." + info["Config"]["Domainname"]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue