Class: Holodekk::Image::Instructions::Run::Options::WithBindMount
- Inherits:
-
Builder::Option
- Object
- Builder::Option
- Holodekk::Image::Instructions::Run::Options::WithBindMount
- Defined in:
- lib/holodekk/image/instructions/run/options/with_bind_mount.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#readonly ⇒ Object
(also: #readonly?)
Returns the value of attribute readonly.
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Builder::Option
#as_dockerfile, #as_json, #to_json
Instance Attribute Details
#from ⇒ Object
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 |
#readonly ⇒ Object 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 |
#source ⇒ Object
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 |
#target ⇒ Object
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_dockerfile ⇒ Object
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 |