Class: Dapp::Dimg::Config::Directive::Docker::Base
- Inherits:
-
Base
- Object
- Config::Directive::Base
- Base
- Dapp::Dimg::Config::Directive::Docker::Base
- Defined in:
- lib/dapp/dimg/config/directive/docker/base.rb
Instance Attribute Summary collapse
-
#_from ⇒ Object
readonly
Returns the value of attribute _from.
-
#_from_cache_version ⇒ Object
readonly
Returns the value of attribute _from_cache_version.
Instance Method Summary collapse
Methods inherited from Base
Methods inherited from Config::Directive::Base
#clone, #encode_with, #initialize
Constructor Details
This class inherits a constructor from Dapp::Config::Directive::Base
Instance Attribute Details
#_from ⇒ Object (readonly)
Returns the value of attribute _from.
7 8 9 |
# File 'lib/dapp/dimg/config/directive/docker/base.rb', line 7 def _from @_from end |
#_from_cache_version ⇒ Object (readonly)
Returns the value of attribute _from_cache_version.
7 8 9 |
# File 'lib/dapp/dimg/config/directive/docker/base.rb', line 7 def _from_cache_version @_from_cache_version end |
Instance Method Details
#from(image, cache_version: nil) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/dapp/dimg/config/directive/docker/base.rb', line 9 def from(image, cache_version: nil) sub_directive_eval do image = image.to_s raise(::Dapp::Error::Config, code: :docker_from_incorrect, data: { name: image }) unless ::Dapp::Dimg::Image::Stage.image_name?(image) @_from = image.include?(':') ? image : [image, 'latest'].join(':') @_from_cache_version = cache_version end end |