diff --git a/files/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/docker/provider.rb b/files/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/docker/provider.rb index d33574c..0c1f80a 100644 --- a/files/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/docker/provider.rb +++ b/files/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/docker/provider.rb @@ -1,6 +1,7 @@ require "digest/md5" require "fileutils" require "thread" +require "uri" require "log4r" @@ -136,6 +137,17 @@ def host_vm? end end + # This checks whether the host system is configured to talk to a remote + # docker host by inspecting the `DOCKER_HOST` env var. + def remote_docker_host? + !ENV['DOCKER_HOST'].to_s.strip.empty? + end + + # Returns the host part from the `DOCKER_HOST` env var + def remote_docker_host + URI.parse(ENV['DOCKER_HOST']).host + end + # Returns the forwarded SSH port on the host. If no port forwarding # for "ssh" is found we return nil def forwarded_ssh_host_port