Module: Algo::Docker
- Defined in:
- lib/algo/docker.rb,
lib/algo/docker/base.rb,
lib/algo/docker/error.rb,
lib/algo/docker/network.rb,
lib/algo/docker/service.rb,
lib/algo/docker/version.rb,
lib/algo/docker/connection.rb
Defined Under Namespace
Modules: Error
Classes: Base, Connection, Network, Service
Constant Summary
collapse
- API_VERSION =
'1.24'
Class Method Summary
collapse
Class Method Details
.connection ⇒ Object
12
13
14
|
# File 'lib/algo/docker.rb', line 12
def connection
@connection ||= Connection.new(url, options)
end
|
.env_options ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/algo/docker.rb', line 36
def env_options
if cert_path = ENV['DOCKER_CERT_PATH']
{
client_cert: File.join(cert_path, 'cert.pem'),
client_key: File.join(cert_path, 'key.pem'),
ssl_ca_file: File.join(cert_path, 'ca.pem'),
scheme: 'https'
}.merge(ssl_options)
else
{}
end
end
|
.env_url ⇒ Object
32
33
34
|
# File 'lib/algo/docker.rb', line 32
def env_url
ENV['DOCKER_URL'] || ENV['DOCKER_HOST']
end
|
.options ⇒ Object
24
25
26
|
# File 'lib/algo/docker.rb', line 24
def options
@options || env_options
end
|
.options=(new_options) ⇒ Object
28
29
30
|
# File 'lib/algo/docker.rb', line 28
def options=(new_options)
@options = env_options.merge(new_options)
end
|
.ssl_options ⇒ Object
49
50
51
52
53
54
55
56
57
|
# File 'lib/algo/docker.rb', line 49
def ssl_options
if ENV['DOCKER_SSL_VERIFY'] == 'false'
{
ssl_verify_peer: false
}
else
{}
end
end
|
.url ⇒ Object
16
17
18
|
# File 'lib/algo/docker.rb', line 16
def url
@url || env_url
end
|
.url=(new_url) ⇒ Object
20
21
22
|
# File 'lib/algo/docker.rb', line 20
def url=(new_url)
@url = new_url
end
|