Class: Vx::ContainerConnector::Docker::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/vx/container_connector/docker/default.rb

Class Method Summary collapse

Class Method Details

.create_container_optionsObject


26
27
28
29
30
31
32
# File 'lib/vx/container_connector/docker/default.rb', line 26

def create_container_options
  if testing?
    { "ExposedPorts" => { "22/tcp" => {} } }
  else
    {}
  end
end

.ssh_hostObject


10
11
12
13
14
15
16
# File 'lib/vx/container_connector/docker/default.rb', line 10

def ssh_host
  if testing?
    'localhost'
  else
    nil
  end
end

.ssh_portObject


18
19
20
21
22
23
24
# File 'lib/vx/container_connector/docker/default.rb', line 18

def ssh_port
  if testing?
    2122
  else
    nil
  end
end

.start_container_optionsObject


34
35
36
37
38
39
40
# File 'lib/vx/container_connector/docker/default.rb', line 34

def start_container_options
  if testing?
    { "PortBindings" => { "22/tcp" => [{ "HostPort" => "2022" }] } }
  else
    {}
  end
end

.testing?Boolean

Returns:

  • (Boolean)

42
43
44
# File 'lib/vx/container_connector/docker/default.rb', line 42

def testing?
  ENV['VX_ENV'] == 'test'
end