From 9ff18fb1b7fd8fb4e21c89af77ed1a10be4534de Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 30 Aug 2014 22:29:46 -0700 Subject: [PATCH] providers/docker: unique name with docker-run --- plugins/providers/docker/action/create.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/providers/docker/action/create.rb b/plugins/providers/docker/action/create.rb index 4b0334d5a..e960f10b0 100644 --- a/plugins/providers/docker/action/create.rb +++ b/plugins/providers/docker/action/create.rb @@ -32,18 +32,15 @@ module VagrantPlugins # Remove container after execution params[:rm] = true if env[:run_rm] - # Name should not be used with run_command - params[:name] = UNSET_VALUE + # Name should be unique + params[:name] = "#{params[:name]}_#{Time.now.to_i}" # We link to our original container # TODO end env[:ui].output(I18n.t("docker_provider.creating")) - - if params[:name] != UNSET_VALUE - env[:ui].detail(" Name: #{params[:name]}") - end + env[:ui].detail(" Name: #{params[:name]}") env[:ui].detail(" Image: #{params[:image]}") if params[:cmd] && !params[:cmd].empty?