class Rummager::ContainerCreateTask

Attributes

args_create[RW]
command[RW]
exposed_ports[RW]
image_name[RW]
repo_base[RW]

Public Class Methods

new(task_name, app) click to toggle source
Calls superclass method
# File lib/rummager/containers.rb, line 92
def initialize(task_name, app)
  super(task_name,app)
  @actions << Proc.new {
    create_args = @args_create
    create_args['Image'] = "#{@repo_base}/#{@image_name}:latest"
    create_args['name'] = @container_name
    if @command
      create_args['Cmd'] = @command
    end
    if @exposed_ports
      create_args['ExposedPorts'] = {};
      @exposed_ports.each do |prt|
        create_args['ExposedPorts'][prt] = {}
      end
    end
    newcont = Docker::Container.create( create_args )
    puts "created container '#{@container_name}' -> #{newcont.json}" if Rake.verbose == true
  }
end

Public Instance Methods

needed?() click to toggle source
# File lib/rummager/containers.rb, line 88
def needed?
  ! has_container?
end