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"]