Class: Holodekk::Image::Instructions::Healthcheck

Inherits:
Builder::Instruction show all
Defined in:
lib/holodekk/image/instructions/healthcheck.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Builder::Instruction

#as_json, instruction_tag, tag, #tag, #to_json

Instance Attribute Details

#cmdObject

Returns the value of attribute cmd.



7
8
9
# File 'lib/holodekk/image/instructions/healthcheck.rb', line 7

def cmd
  @cmd
end

#intervalObject

Returns the value of attribute interval.



7
8
9
# File 'lib/holodekk/image/instructions/healthcheck.rb', line 7

def interval
  @interval
end

#retriesObject

Returns the value of attribute retries.



7
8
9
# File 'lib/holodekk/image/instructions/healthcheck.rb', line 7

def retries
  @retries
end

#startObject

Returns the value of attribute start.



7
8
9
# File 'lib/holodekk/image/instructions/healthcheck.rb', line 7

def start
  @start
end

#timeoutObject

Returns the value of attribute timeout.



7
8
9
# File 'lib/holodekk/image/instructions/healthcheck.rb', line 7

def timeout
  @timeout
end

Class Method Details

.build(cmd, **kwargs) ⇒ Object



11
12
13
# File 'lib/holodekk/image/instructions/healthcheck.rb', line 11

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

Instance Method Details

#to_dockerfileObject



15
16
17
18
19
20
21
22
23
# File 'lib/holodekk/image/instructions/healthcheck.rb', line 15

def to_dockerfile
  builder = Docker::Dockerfile::InstructionBuilder.new(self)
  add_option(builder, 'interval')
  add_option(builder, 'timeout')
  add_option(builder, 'start')
  add_option(builder, 'retries')
  builder.raw_value(cmd)
  builder.output
end