Last active
August 29, 2015 14:09
-
-
Save ianblenke/5335483e4021954d815f to your computer and use it in GitHub Desktop.
Boot2docker friendly docker-api spec_helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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