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
12
13
14
15
# File 'lib/dapp/config/docker.rb', line 8

def initialize
  @_volume = []
  @_expose = []
  @_env = []
  @_label = []
  @_cmd = []
  @_onbuild = []
end

Instance Attribute Details

#_cmdObject (readonly)

Returns the value of attribute _cmd.



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

def _cmd
  @_cmd
end

#_entrypointObject (readonly)

Returns the value of attribute _entrypoint.



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

def _entrypoint
  @_entrypoint
end

#_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

#_labelObject (readonly)

Returns the value of attribute _label.



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

def _label
  @_label
end

#_onbuildObject (readonly)

Returns the value of attribute _onbuild.



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

def _onbuild
  @_onbuild
end

#_userObject (readonly)

Returns the value of attribute _user.



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

def _user
  @_user
end

#_volumeObject (readonly)

Returns the value of attribute _volume.



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

def _volume
  @_volume
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

#_change_optionsObject



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/dapp/config/docker.rb', line 62

def _change_options
  {
    volume: _volume,
    expose: _expose,
    env: _env,
    label: _label,
    cmd: _cmd,
    onbuild: _onbuild,
    workdir: _workdir,
    user: _user,
    entrypoint: _entrypoint
  }
end

#_fromObject



58
59
60
# File 'lib/dapp/config/docker.rb', line 58

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

#cloneObject



76
77
78
# File 'lib/dapp/config/docker.rb', line 76

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

#cmd(*args) ⇒ Object



38
39
40
# File 'lib/dapp/config/docker.rb', line 38

def cmd(*args)
  @_cmd.concat(args)
end

#entrypoint(*cmd_with_args) ⇒ Object



54
55
56
# File 'lib/dapp/config/docker.rb', line 54

def entrypoint(*cmd_with_args)
  @_entrypoint = cmd_with_args.flatten
end

#env(*args) ⇒ Object



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

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

#expose(*args) ⇒ Object



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

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

#from(image_name, cache_version: nil) ⇒ Object



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

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

#label(*args) ⇒ Object



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

def label(*args)
  @_label.concat(args)
end

#onbuild(*args) ⇒ Object



42
43
44
# File 'lib/dapp/config/docker.rb', line 42

def onbuild(*args)
  @_onbuild.concat(args)
end

#user(val) ⇒ Object



50
51
52
# File 'lib/dapp/config/docker.rb', line 50

def user(val)
  @_user = val
end

#volume(*args) ⇒ Object



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

def volume(*args)
  @_volume.concat(args)
end

#workdir(val) ⇒ Object



46
47
48
# File 'lib/dapp/config/docker.rb', line 46

def workdir(val)
  @_workdir = val
end