diff --git a/plugins/providers/docker/driver.rb b/plugins/providers/docker/driver.rb index 546b06dfd..987437c1b 100644 --- a/plugins/providers/docker/driver.rb +++ b/plugins/providers/docker/driver.rb @@ -31,7 +31,7 @@ module VagrantPlugins def create(params, **opts, &block) image = params.fetch(:image) - links = Array(params.fetch(:links)) + links = params.fetch(:links) ports = Array(params[:ports]) volumes = Array(params[:volumes]) name = params.fetch(:name) @@ -43,7 +43,7 @@ module VagrantPlugins run_cmd << "-d" if params[:detach] run_cmd += env.map { |k,v| ['-e', "#{k}=#{v}"] } run_cmd += expose.map { |p| ['--expose', "#{p}"] } - run_cmd += links.map { |l| ['--link', "#{l}"] } + run_cmd += links.map { |k, v| ['--link', "#{k}:#{v}"] } run_cmd += ports.map { |p| ['-p', p.to_s] } run_cmd += volumes.map { |v| ['-v', v.to_s] } run_cmd += %W(--privileged) if params[:privileged]