lib/kitchen/driver/docker.rb in kitchen-docker-0.13.0 vs lib/kitchen/driver/docker.rb in kitchen-docker-1.0.0.beta
- old
+ new
@@ -24,11 +24,11 @@
# Docker driver for Kitchen.
#
# @author Sean Porter <portertech@gmail.com>
class Docker < Kitchen::Driver::SSHBase
- default_config :socket, nil
+ default_config :socket, 'unix:///var/run/docker.sock'
default_config :privileged, false
default_config :remove_images, false
default_config :run_command, '/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no'
default_config :username, 'kitchen'
default_config :password, 'kitchen'
@@ -43,20 +43,22 @@
default_config :platform do |driver|
driver.default_platform
end
+ default_config :disable_upstart, true
+
def verify_dependencies
run_command('docker > /dev/null', :quiet => true)
rescue
raise UserError,
- 'You must first install Docker http://www.docker.io/gettingstarted/'
+ 'You must first install the Docker CLI tool http://www.docker.io/gettingstarted/'
end
def default_image
platform, release = instance.platform.name.split('-')
- release ? [platform, release].join(':') : 'base'
+ release ? [platform, release].join(':') : platform
end
def default_platform
instance.platform.name.split('-').first || 'ubuntu'
end
@@ -94,16 +96,19 @@
def dockerfile
from = "FROM #{config[:image]}"
platform = case config[:platform]
when 'debian', 'ubuntu'
- <<-eos
- ENV DEBIAN_FRONTEND noninteractive
+ disable_upstart = <<-eos
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
+ eos
+ packages = <<-eos
+ ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y sudo openssh-server curl lsb-release
eos
+ config[:disable_upstart] ? disable_upstart + packages : packages
when 'rhel', 'centos'
<<-eos
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients curl
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key