diff options
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]) |