Class: Dapp::Config::Directive::Docker::Base
- Inherits:
-
Object
- Object
- Dapp::Config::Directive::Docker::Base
- Defined in:
- lib/dapp/config/directive/docker/base.rb
Overview
Base
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 ⇒ Object
readonly
Returns the value of attribute _from.
-
#_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
- #cmd(*args) ⇒ Object
- #entrypoint(*cmd_with_args) ⇒ Object
- #env(**options) ⇒ Object
- #expose(*args) ⇒ Object
- #from(image, cache_version: nil) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #label(**options) ⇒ Object
- #onbuild(*args) ⇒ Object
- #user(val) ⇒ Object
- #volume(*args) ⇒ Object
- #workdir(val) ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 |
# File 'lib/dapp/config/directive/docker/base.rb', line 11 def initialize @_volume = [] @_expose = [] @_env = {} @_label = {} @_cmd = [] @_onbuild = [] end |
Instance Attribute Details
#_cmd ⇒ Object (readonly)
Returns the value of attribute _cmd.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _cmd @_cmd end |
#_entrypoint ⇒ Object (readonly)
Returns the value of attribute _entrypoint.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _entrypoint @_entrypoint end |
#_env ⇒ Object (readonly)
Returns the value of attribute _env.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _env @_env end |
#_expose ⇒ Object (readonly)
Returns the value of attribute _expose.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _expose @_expose end |
#_from ⇒ Object (readonly)
Returns the value of attribute _from.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _from @_from end |
#_from_cache_version ⇒ Object (readonly)
Returns the value of attribute _from_cache_version.
9 10 11 |
# File 'lib/dapp/config/directive/docker/base.rb', line 9 def _from_cache_version @_from_cache_version end |
#_label ⇒ Object (readonly)
Returns the value of attribute _label.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _label @_label end |
#_onbuild ⇒ Object (readonly)
Returns the value of attribute _onbuild.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _onbuild @_onbuild end |
#_user ⇒ Object (readonly)
Returns the value of attribute _user.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _user @_user end |
#_volume ⇒ Object (readonly)
Returns the value of attribute _volume.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 def _volume @_volume end |
#_workdir ⇒ Object (readonly)
Returns the value of attribute _workdir.
8 9 10 |
# File 'lib/dapp/config/directive/docker/base.rb', line 8 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/directive/docker/base.rb', line 62 def { volume: _volume, expose: _expose, env: _env, label: _label, cmd: _cmd, onbuild: _onbuild, workdir: _workdir, user: _user, entrypoint: _entrypoint } end |
#cmd(*args) ⇒ Object
42 43 44 |
# File 'lib/dapp/config/directive/docker/base.rb', line 42 def cmd(*args) @_cmd.concat(args) end |
#entrypoint(*cmd_with_args) ⇒ Object
58 59 60 |
# File 'lib/dapp/config/directive/docker/base.rb', line 58 def entrypoint(*cmd_with_args) @_entrypoint = cmd_with_args.flatten end |
#env(**options) ⇒ Object
34 35 36 |
# File 'lib/dapp/config/directive/docker/base.rb', line 34 def env(**) @_env.merge!() end |
#expose(*args) ⇒ Object
30 31 32 |
# File 'lib/dapp/config/directive/docker/base.rb', line 30 def expose(*args) @_expose.concat(args) end |
#from(image, cache_version: nil) ⇒ Object
20 21 22 23 24 |
# File 'lib/dapp/config/directive/docker/base.rb', line 20 def from(image, cache_version: nil) raise(Error::Config, code: :docker_from_incorrect, data: { name: image }) unless image =~ /^[[^ ].]+:[[^ ].]+$/ @_from = image @_from_cache_version = cache_version end |
#label(**options) ⇒ Object
38 39 40 |
# File 'lib/dapp/config/directive/docker/base.rb', line 38 def label(**) @_label.merge!() end |
#onbuild(*args) ⇒ Object
46 47 48 |
# File 'lib/dapp/config/directive/docker/base.rb', line 46 def onbuild(*args) @_onbuild.concat(args) end |
#user(val) ⇒ Object
54 55 56 |
# File 'lib/dapp/config/directive/docker/base.rb', line 54 def user(val) @_user = val end |
#volume(*args) ⇒ Object
26 27 28 |
# File 'lib/dapp/config/directive/docker/base.rb', line 26 def volume(*args) @_volume.concat(args) end |
#workdir(val) ⇒ Object
50 51 52 |
# File 'lib/dapp/config/directive/docker/base.rb', line 50 def workdir(val) @_workdir = val end |