Method: Beaker::Docker#initialize

Defined in:
lib/beaker/hypervisor/docker.rb

#initialize(hosts, options) ⇒ Docker

Returns a new instance of Docker.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/beaker/hypervisor/docker.rb', line 4

def initialize(hosts, options)
  require 'docker'
  @options = options
  @logger = options[:logger]
  @hosts = hosts

  # increase the http timeouts as provisioning images can be slow
  ::Docker.options = { :write_timeout => 300, :read_timeout => 300 }.merge(::Docker.options || {})
  # assert that the docker-api gem can talk to your docker
  # enpoint.  Will raise if there is a version mismatch
  ::Docker.validate_version!
  # Pass on all the logging from docker-api to the beaker logger instance
  ::Docker.logger = @logger
end