Sha256: e5a0c2521f2316177ffa4931a4e1c77e5ffd5cc52d28ea9c93e1dffbacd2372e
Contents?: true
Size: 1020 Bytes
Versions: 5
Compression:
Stored size: 1020 Bytes
Contents
module Percheron module Container module Actions class Create def initialize(container) @container = container end def execute! unless image_exists? $logger.debug "Creating '#{container.image}' image" Container::Actions::Build.new(container).execute! end $logger.debug "Creating '#{container.name}' container" Docker::Container.create(create_opts) end private attr_reader :container def create_opts { 'name' => container.name, 'Image' => container.image, 'Hostname' => container.name, 'Env' => container.env, 'ExposedPorts' => container.exposed_ports, 'VolumesFrom' => container.volumes } end def image_exists? Docker::Image.exist?(container.image) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems