Sha256: 97b7b359ffbba12c67bde8ceb256956ada319f7dda93ebfa2eab25dec318d501
Contents?: true
Size: 906 Bytes
Versions: 9
Compression:
Stored size: 906 Bytes
Contents
module Percheron module Container module Actions class Start def initialize(container) @container = container end def execute! if container.exists? $logger.debug "Starting '#{container.name}'" container.docker_container.start!(start_opts) else raise Errors::ContainerDoesNotExist.new end end private attr_reader :container def start_opts opts = container.ports.inject({}) do |all, p| destination, source = p.split(':') all[source] = [ { 'HostPort' => destination } ] all end { 'PortBindings' => opts, 'Links' => container.links, 'Binds' => container.volumes } end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems