Class: Dapp::Dimg::Config::Directive::Docker::Base

Inherits:
Base show all
Defined in:
lib/dapp/dimg/config/directive/docker/base.rb

Direct Known Subclasses

Artifact, Dimg

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Config::Base

#initialize

Constructor Details

This class inherits a constructor from Dapp::Config::Base

Instance Attribute Details

#_fromObject (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_versionObject (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

Raises:



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)
  image = image.to_s
  raise(Error::Config, code: :docker_from_incorrect,
                       data: { name: image }) unless ::Dapp::Dimg::Image::Docker.image_name?(image)
  raise(Error::Config, code: :docker_from_without_tag, data: { name: image }) unless image.include?(':')
  @_from = image
  @_from_cache_version = cache_version
end