Class: Dapp::Config::Docker
- Inherits:
-
Object
- Object
- Dapp::Config::Docker
- Defined in:
- lib/dapp/config/docker.rb
Overview
Docker
Instance Attribute Summary collapse
-
#_cmd ⇒ Object
readonly
Returns the value of attribute _cmd.
-
#_entrypoint ⇒ Object
readonly
Returns the value of attribute _entrypoint.
-
#_env ⇒ Object
readonly
Returns the value of attribute _env.
-
#_expose ⇒ Object
readonly
Returns the value of attribute _expose.
-
#_from_cache_version ⇒ Object
readonly
Returns the value of attribute _from_cache_version.
-
#_label ⇒ Object
readonly
Returns the value of attribute _label.
-
#_onbuild ⇒ Object
readonly
Returns the value of attribute _onbuild.
-
#_user ⇒ Object
readonly
Returns the value of attribute _user.
-
#_volume ⇒ Object
readonly
Returns the value of attribute _volume.
-
#_workdir ⇒ Object
readonly
Returns the value of attribute _workdir.
Instance Method Summary collapse
- #_change_options ⇒ Object
- #_from ⇒ Object
- #clone ⇒ Object
- #cmd(*args) ⇒ Object
- #entrypoint(*cmd_with_args) ⇒ Object
- #env(*args) ⇒ Object
- #expose(*args) ⇒ Object
- #from(image_name, cache_version: nil) ⇒ Object
-
#initialize ⇒ Docker
constructor
A new instance of Docker.
- #label(*args) ⇒ Object
- #onbuild(*args) ⇒ Object
- #user(val) ⇒ Object
- #volume(*args) ⇒ Object
- #workdir(val) ⇒ Object
Constructor Details
#initialize ⇒ Docker
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
#_cmd ⇒ Object (readonly)
Returns the value of attribute _cmd.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _cmd @_cmd end |
#_entrypoint ⇒ Object (readonly)
Returns the value of attribute _entrypoint.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _entrypoint @_entrypoint end |
#_env ⇒ Object (readonly)
Returns the value of attribute _env.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _env @_env end |
#_expose ⇒ Object (readonly)
Returns the value of attribute _expose.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _expose @_expose end |
#_from_cache_version ⇒ Object (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 |
#_label ⇒ Object (readonly)
Returns the value of attribute _label.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _label @_label end |
#_onbuild ⇒ Object (readonly)
Returns the value of attribute _onbuild.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _onbuild @_onbuild end |
#_user ⇒ Object (readonly)
Returns the value of attribute _user.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _user @_user end |
#_volume ⇒ Object (readonly)
Returns the value of attribute _volume.
5 6 7 |
# File 'lib/dapp/config/docker.rb', line 5 def _volume @_volume end |
#_workdir ⇒ Object (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_options ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/dapp/config/docker.rb', line 62 def { volume: _volume, expose: _expose, env: _env, label: _label, cmd: _cmd, onbuild: _onbuild, workdir: _workdir, user: _user, entrypoint: _entrypoint } end |
#_from ⇒ Object
58 59 60 |
# File 'lib/dapp/config/docker.rb', line 58 def _from @_from || raise(Error::Config, code: :docker_from_not_defined) end |
#clone ⇒ Object
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 |