Class: Holodekk::Image::Instructions::Run::Options::WithSecretMount

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

Defined Under Namespace

Classes: OptionBuilder

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_secret_mount.rb', line 9

def from
  @from
end

#gidObject

Returns the value of attribute gid.



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

def gid
  @gid
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#modeObject

Returns the value of attribute mode.



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

def mode
  @mode
end

#readonlyObject Also known as: readonly?

Returns the value of attribute readonly.



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

def readonly
  @readonly
end

#sharingObject

Returns the value of attribute sharing.



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

def sharing
  @sharing
end

#sourceObject

Returns the value of attribute source.



9
10
11
# File 'lib/holodekk/image/instructions/run/options/with_secret_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_secret_mount.rb', line 9

def target
  @target
end

#uidObject

Returns the value of attribute uid.



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

def uid
  @uid
end

Class Method Details

.buld(target, **kwargs) ⇒ Object



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

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

Instance Method Details

#to_dockerfileObject



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

def to_dockerfile
  builder = OptionBuilder.new('mount=type=cache')
  builder.build do
    pair 'target', target
    %i[from gid id mode sharing source uid].each do |key|
      v = send(key)
      pair key, v unless v.nil?
      flag 'readonly' if readonly?
    end
  end
  builder.output
end