Class: Dapp::Config::Docker
- Inherits:
-
Object
- Object
- Dapp::Config::Docker
- Defined in:
- lib/dapp/config/docker.rb
Overview
Docker
Instance Attribute Summary collapse
-
#_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.
-
#_workdir ⇒ Object
readonly
Returns the value of attribute _workdir.
Instance Method Summary collapse
- #_from ⇒ Object
- #clone ⇒ Object
- #env(*args) ⇒ Object
- #expose(*args) ⇒ Object
- #from(image_name, cache_version: nil) ⇒ Object
-
#initialize ⇒ Docker
constructor
A new instance of Docker.
- #workdir(path) ⇒ Object
Constructor Details
#initialize ⇒ Docker
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
#_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 |
#_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
#_from ⇒ Object
30 31 32 |
# File 'lib/dapp/config/docker.rb', line 30 def _from @_from || fail(Error::Config, code: :docker_from_not_defined) end |
#clone ⇒ Object
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 |