diff --git a/plugins/provisioners/docker/config.rb b/plugins/provisioners/docker/config.rb index bd8ec5140..b4a2d57c5 100644 --- a/plugins/provisioners/docker/config.rb +++ b/plugins/provisioners/docker/config.rb @@ -20,22 +20,12 @@ module VagrantPlugins @images += images.map(&:to_s) end - def run(*args) - container_name = args.shift - params = {} - - if args.empty? - params[:image] = container_name - elsif args.first.is_a?(String) - params[:image] = args.shift - params[:cmd] = container_name - else - params = args.shift - params[:cmd] ||= container_name - end + def run(name, **options) + params = options.dup + params[:image] = name # TODO: Validate provided parameters before assignment - @containers[container_name.to_s] = params + @containers[name.to_s] = params end def finalize! diff --git a/plugins/provisioners/docker/docker_client.rb b/plugins/provisioners/docker/docker_client.rb index 895d21ce1..16af2e028 100644 --- a/plugins/provisioners/docker/docker_client.rb +++ b/plugins/provisioners/docker/docker_client.rb @@ -30,8 +30,11 @@ module VagrantPlugins cids_dir = "/var/lib/vagrant/cids" config[:cidfile] ||= "#{cids_dir}/#{Digest::SHA1.hexdigest name}" + @machine.ui.info(I18n.t("vagrant.docker_running", name: name)) @machine.communicate.sudo("mkdir -p #{cids_dir}") - run_container({name: name}.merge config) + run_container({ + name: name + }.merge(config)) end end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 0f0dfedbd..97b596e9e 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -47,6 +47,8 @@ en: Installing Docker onto machine... docker_pulling_images: Pulling Docker images... + docker_running: |- + -- Container: %{name} docker_starting_containers: Starting Docker containers... docker_auto_start_not_available: |-