From 1eb3a8ded7f8da1962354441ce7df60fcac2b538 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 4 Sep 2020 06:16:55 +0200 Subject: [PATCH] Fixes for network stuff. --- dup.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dup.rb b/dup.rb index 0cb107d..51714da 100755 --- a/dup.rb +++ b/dup.rb @@ -226,8 +226,9 @@ class Container def filename; "%s/%s.yml" % [$base_dir, @name]; end def build_run_command + $net_host = true if @data["net"]=="host" cmd = ["docker", "create"] - cmd << "--net" << @data["networks"][0] if @data["networks"] && !$net_host + cmd << "--net" << @data["networks"][0] if @data["networks"] && @data["networks"].count>0 && !$net_host cmd << "--net" << "host" if $net_host if !@data["test"]