lib/kitchen/driver/docker.rb in kitchen-docker-1.2.1 vs lib/kitchen/driver/docker.rb in kitchen-docker-1.3.1
- old
+ new
@@ -34,10 +34,15 @@
default_config :use_cache, true
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'
+ default_config :tls, false
+ default_config :tls_verify, false
+ default_config :tls_cacert, nil
+ default_config :tls_cert, nil
+ default_config :tls_key, nil
default_config :use_sudo do |driver|
!driver.remote_socket?
end
@@ -93,9 +98,14 @@
end
def docker_command(cmd, options={})
docker = config[:binary].dup
docker << " -H #{config[:socket]}" if config[:socket]
+ docker << " --tls" if config[:tls]
+ docker << " --tlsverify" if config[:tls_verify]
+ docker << " --tlscacert=#{config[:tls_cacert]}" if config[:tls_cacert]
+ docker << " --tlscert=#{config[:tls_cert]}" if config[:tls_cert]
+ docker << " --tlskey=#{config[:tls_key]}" if config[:tls_key]
run_command("#{docker} #{cmd}", options.merge(:quiet => !logger.debug?))
end
def build_dockerfile
from = "FROM #{config[:image]}"