diff options
author | Anca Iordache <anca.iordache@docker.com> | 2021-03-09 18:28:36 +0100 |
---|---|---|
committer | Anca Iordache <anca.iordache@docker.com> | 2021-03-09 18:30:47 +0100 |
commit | 3e071ec8d96c04a033c467a3d06bad192cb89d8a (patch) | |
tree | a115ff713dc13f56a41c220acb7f967d8f2888a5 /compose/service.py | |
parent | d0b7bc3110a0794066605670ac4c760c099bab69 (diff) |
Fix build.extra_hosts list format
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
Diffstat (limited to 'compose/service.py')
-rw-r--r-- | compose/service.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compose/service.py b/compose/service.py index 3829e826..53cf42ae 100644 --- a/compose/service.py +++ b/compose/service.py @@ -1877,8 +1877,10 @@ class _CLIBuilder: command_builder.add_arg("--isolation", isolation) if extra_hosts: - for host, ip in extra_hosts.items(): - command_builder.add_arg("--add-host", "{}:{}".format(host, ip)) + if isinstance(extra_hosts, dict): + extra_hosts = ["{}:{}".format(host, ip) for host, ip in extra_hosts.items()] + for host in extra_hosts: + command_builder.add_arg("--add-host", "{}".format(host)) args = command_builder.build([path]) |