FIXES #413: parse network_mode: container:container_name correctly

Signed-off-by: Bernd Schoolmann <mail@quexten.com>
This commit is contained in:
Bernd Schoolmann 2022-01-29 23:45:25 +01:00 committed by Muayyad Alsadi
parent 09c6cbe503
commit 536925ca78

View File

@ -620,6 +620,9 @@ def get_net_args(compose, cnt):
other_srv = net.split(":", 1)[1].strip()
other_cnt = compose.container_names_by_service[other_srv][0]
return ['--network', f"container:{other_cnt}"]
if net.startswith("container:"):
other_cnt = net.split(":",1)[1].strip()
return ['--network', f"container:{other_cnt}"]
proj_name = compose.project_name
default_net = compose.default_net
nets = compose.networks