class Buildizer::Image
Attributes
from[R]
instructions[R]
name[R]
target[R]
Public Class Methods
new(name, target, from: nil)
click to toggle source
# File lib/buildizer/image.rb, line 9 def initialize(name, target, from: nil) @name = name @target = target @instructions = [] @from = from instruction :FROM, from if from end
Public Instance Methods
build_path()
click to toggle source
# File lib/buildizer/image.rb, line 23 def build_path target.image_build_path end
dockerfile_dump()
click to toggle source
# File lib/buildizer/image.rb, line 39 def dockerfile_dump [instructions, nil].join("\n") end
dockerfile_name()
click to toggle source
# File lib/buildizer/image.rb, line 31 def dockerfile_name "#{name}.dockerfile" end
dockerfile_path()
click to toggle source
# File lib/buildizer/image.rb, line 35 def dockerfile_path target.image_work_path.join(dockerfile_name) end
dockerfile_write!()
click to toggle source
# File lib/buildizer/image.rb, line 43 def dockerfile_write! dockerfile_path.write! dockerfile_dump end
extra_path()
click to toggle source
# File lib/buildizer/image.rb, line 27 def extra_path target.image_extra_path end
instruction(instruction, cmd)
click to toggle source
# File lib/buildizer/image.rb, line 19 def instruction(instruction, cmd) instructions << [instruction.to_s.upcase, cmd].join(' ') end