Class: Dapp::Config::Docker

Inherits:
Object
  • Object
show all
Defined in:
lib/dapp/config/docker.rb

Overview

Docker

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDocker

Returns a new instance of Docker.



8
9
10
11
# File 'lib/dapp/config/docker.rb', line 8

def initialize
  @_expose = []
  @_env = []
end

Instance Attribute Details

#_envObject (readonly)

Returns the value of attribute _env.



5
6
7
# File 'lib/dapp/config/docker.rb', line 5

def _env
  @_env
end

#_exposeObject (readonly)

Returns the value of attribute _expose.



5
6
7
# File 'lib/dapp/config/docker.rb', line 5

def _expose
  @_expose
end

#_from_cache_versionObject (readonly)

Returns the value of attribute _from_cache_version.



6
7
8
# File 'lib/dapp/config/docker.rb', line 6

def _from_cache_version
  @_from_cache_version
end

#_workdirObject (readonly)

Returns the value of attribute _workdir.



5
6
7
# File 'lib/dapp/config/docker.rb', line 5

def _workdir
  @_workdir
end

Instance Method Details

#_fromObject



30
31
32
# File 'lib/dapp/config/docker.rb', line 30

def _from
  @_from || fail(Error::Config, code: :docker_from_not_defined)
end

#cloneObject



34
35
36
# File 'lib/dapp/config/docker.rb', line 34

def clone
  Marshal.load(Marshal.dump(self))
end

#env(*args) ⇒ Object



26
27
28
# File 'lib/dapp/config/docker.rb', line 26

def env(*args)
  @_env.concat(args)
end

#expose(*args) ⇒ Object



18
19
20
# File 'lib/dapp/config/docker.rb', line 18

def expose(*args)
  @_expose.concat(args)
end

#from(image_name, cache_version: nil) ⇒ Object



13
14
15
16
# File 'lib/dapp/config/docker.rb', line 13

def from(image_name, cache_version: nil)
  @_from = image_name
  @_from_cache_version = cache_version
end

#workdir(path) ⇒ Object



22
23
24
# File 'lib/dapp/config/docker.rb', line 22

def workdir(path)
  @_workdir = path
end