Class: Indocker::Launchers::ImagesCompiler

Inherits:
Object
  • Object
show all
Defined in:
lib/indocker/launchers/images_compiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ ImagesCompiler

Returns a new instance of ImagesCompiler.



2
3
4
# File 'lib/indocker/launchers/images_compiler.rb', line 2

def initialize(logger)
  @logger = logger
end

Instance Method Details

#compile(configuration:, image_list:, skip_dependent:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/indocker/launchers/images_compiler.rb', line 6

def compile(configuration:, image_list:, skip_dependent:)
  preload_images(configuration, image_list)

  build_context = Indocker::BuildContext.new(
    configuration: configuration,
    logger: @logger,
    global_logger: Indocker.global_logger
  )

  image_compiler = Indocker::Images::ImageCompiler.new

  image_list.each do |image_name|
    image = Indocker.configuration.images.detect do |i|
      i.name == image_name
    end

    image_compiler.compile(build_context, image, skip_dependent)
  end
end