lib/brick/docker/docker_client.rb
#if the container is already existed, reuse it
#if the container is not started, start it
if the container is already existed, reuse it
if the container is not started, start it
if the container is already existed reuse it if the container is not started start it
def run config_hash, name=nil
        container = get_container_by_name name
        if container.nil?
          container = create config_hash, name
        else
          Brick::CLI::logger.info "container #{name} has already existed."
        end
        Brick::CLI::logger.debug "container #{container}."
        unless container.is_running?
          container.start(start_config(config_hash))
        else
          Brick::CLI::logger.info "container #{name} is #{container.info["Status"]}"
        end
        container
      end
def run config_hash , name = nil container = get_container_by_name name if container . nil? container = create config_hash , name else Brick :: CLI :: logger . info "container #{name} has already existed." end Brick :: CLI :: logger . debug "container #{container}." unless container . is_running? container . start ( start_config ( config_hash ) ) else Brick :: CLI :: logger . info "container #{name} is #{container.info["Status"]}" end container end
if the container is already existed, reuse it
if the container is not started, start it
if the container is already existed reuse it if the container is not started start it
#byebug        
config_hash
<not_specific>
name
<not_specific>