Skip to content

Commit 310a85f

Browse files
committed
docker "binary" config option, ubuntu 14.04 uses docker.io, default serverspec
1 parent 3f89f57 commit 310a85f

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

lib/kitchen/driver/docker.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module Driver
2727
# @author Sean Porter <portertech@gmail.com>
2828
class Docker < Kitchen::Driver::SSHBase
2929

30+
default_config :binary, 'docker'
3031
default_config :socket, 'unix:///var/run/docker.sock'
3132
default_config :privileged, false
3233
default_config :use_cache, true
@@ -50,7 +51,7 @@ class Docker < Kitchen::Driver::SSHBase
5051
default_config :disable_upstart, true
5152

5253
def verify_dependencies
53-
run_command('docker > /dev/null', :quiet => true)
54+
run_command("#{config[:binary]} > /dev/null", :quiet => true)
5455
rescue
5556
raise UserError,
5657
'You must first install the Docker CLI tool http://www.docker.io/gettingstarted/'
@@ -91,7 +92,7 @@ def socket_uri
9192
end
9293

9394
def docker_command(cmd, options={})
94-
docker = "docker"
95+
docker = config[:binary].dup
9596
docker << " -H #{config[:socket]}" if config[:socket]
9697
run_command("#{docker} #{cmd}", options.merge(:quiet => !logger.debug?))
9798
end
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require 'serverspec'
2+
3+
include Serverspec::Helper::Exec
4+
include Serverspec::Helper::DetectOS
5+
6+
describe file('/etc/passwd') do
7+
it { should be_file }
8+
end

0 commit comments

Comments
 (0)