From 18c76f0a865d3947fad3acd2db0bc0ab666af0a2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 21 Oct 2014 16:19:02 -0700 Subject: [PATCH] provisioners/docker: search for Docker in multiple paths [GH-4580] --- CHANGELOG.md | 1 + .../docker/cap/linux/docker_installed.rb | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20d51ce31..8b02480be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/plugins/provisioners/docker/cap/linux/docker_installed.rb b/plugins/provisioners/docker/cap/linux/docker_installed.rb index f1d05fa2f..11acdac5a 100644 --- a/plugins/provisioners/docker/cap/linux/docker_installed.rb +++ b/plugins/provisioners/docker/cap/linux/docker_installed.rb @@ -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