provisioners/docker: search for Docker in multiple paths [GH-4580]

This commit is contained in:
Mitchell Hashimoto 2014-10-21 16:19:02 -07:00
parent 58f7310444
commit 18c76f0a86
2 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,7 @@ BUG FIXES:
- providers/virtualbox: Show a human-friendly error if VirtualBox didn't
clean up an existing VM. [GH-4681]
- provisioners/docker: Search for docker binary in multiple places. [GH-4580]
## 1.6.5 (September 4, 2014)

View File

@ -4,7 +4,19 @@ module VagrantPlugins
module Linux
module DockerInstalled
def self.docker_installed(machine)
machine.communicate.test("test -f /usr/bin/docker", sudo: true)
paths = [
"/usr/bin/docker",
"/usr/local/bin/docker",
"/usr/sbin/docker",
]
paths.each do |p|
if machine.communicate.test("test -f #{p}", sudo: true)
return true
end
end
return false
end
end
end