Module: DockerCompose

Defined in:
lib/version.rb,
lib/docker-compose.rb

Class Method Summary collapse

Class Method Details

.docker_clientObject

Get Docker client object



13
14
15
# File 'lib/docker-compose.rb', line 13

def self.docker_client
  Docker
end

.load(filepath, do_load_running_containers = false) ⇒ Object

Load a given docker-compose file. Returns a new Compose object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/docker-compose.rb', line 21

def self.load(filepath, do_load_running_containers = false)
  unless File.exist?(filepath)
    raise ArgumentError, 'Compose file doesn\'t exists'
  end

  # Parse the docker-compose config
  config = DockerComposeConfig.new(filepath)

  compose = Compose.new

  # Load new containers
  load_containers_from_config(config, compose)

  # Load running containers
  if do_load_running_containers
    load_running_containers(compose)
  end

  # Perform containers linkage
  compose.link_containers

  compose
end

.versionObject



2
3
4
# File 'lib/version.rb', line 2

def self.version
  "1.1.6"
end