Skip to content

Instantly share code, notes, and snippets.

@ianblenke
Last active August 29, 2015 14:09
Show Gist options
  • Save ianblenke/5335483e4021954d815f to your computer and use it in GitHub Desktop.
Save ianblenke/5335483e4021954d815f to your computer and use it in GitHub Desktop.
Boot2docker friendly docker-api spec_helper
require "docker"
docker_host = ENV['DOCKER_HOST'].dup
if(ENV['DOCKER_TLS_VERIFY'])
cert_path = File.expand_path ENV['DOCKER_CERT_PATH']
Docker.options = {
client_cert: File.join(cert_path, 'cert.pem'),
client_key: File.join(cert_path, 'key.pem')
}
Excon.defaults[:ssl_ca_file] = File.join(cert_path, 'ca.pem')
docker_host.gsub!(/^tcp/,'https')
end
Docker.url = docker_host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment