Class: Holodekk::Image::Instructions::Run::Options::WithBindMount

Inherits:
Builder::Option
  • Object
show all
Defined in:
lib/holodekk/image/instructions/run/options/with_bind_mount.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Builder::Option

#as_dockerfile, #as_json, #to_json

Instance Attribute Details

#fromObject

Returns the value of attribute from.



9
10
11
# File 'lib/holodekk/image/instructions/run/options/with_bind_mount.rb', line 9

def from
  @from
end

#readonlyObject Also known as: readonly?

Returns the value of attribute readonly.



9
10
11
# File 'lib/holodekk/image/instructions/run/options/with_bind_mount.rb', line 9

def readonly
  @readonly
end

#sourceObject

Returns the value of attribute source.



9
10
11
# File 'lib/holodekk/image/instructions/run/options/with_bind_mount.rb', line 9

def source
  @source
end

#targetObject

Returns the value of attribute target.



9
10
11
# File 'lib/holodekk/image/instructions/run/options/with_bind_mount.rb', line 9

def target
  @target
end

Class Method Details

.build(source, target, **kwargs) ⇒ Object



13
14
15
# File 'lib/holodekk/image/instructions/run/options/with_bind_mount.rb', line 13

def self.build(source, target, **kwargs)
  new({ source: source, target: target }.merge(kwargs))
end

Instance Method Details

#to_dockerfileObject



17
18
19
20
21
22
23
24
25
# File 'lib/holodekk/image/instructions/run/options/with_bind_mount.rb', line 17

def to_dockerfile
  chunks = []
  chunks << '--mount=type=bind'
  chunks << "source=#{source}"
  chunks << "target=#{target}"
  chunks << "from=#{from}" unless from.nil?
  chunks << 'readwrite' unless readonly?
  chunks.join(',')
end