浏览代码

Add missing --add-host args to the build command

Signed-off-by: José Rodrigues <[email protected]>
José Rodrigues 4 年之前
父节点
当前提交
72f7b086d7
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      compose/service.py

+ 5 - 0
compose/service.py

@@ -1875,6 +1875,11 @@ class _CLIBuilder:
         command_builder.add_arg("--iidfile", iidfile)
         command_builder.add_arg("--platform", platform)
         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))
+
         args = command_builder.build([path])
 
         magic_word = "Successfully built "