diff --git a/src/faaso.cr b/src/faaso.cr index 709e1c2..eb3bbb9 100644 --- a/src/faaso.cr +++ b/src/faaso.cr @@ -73,13 +73,13 @@ module Faaso end # Bring up one or more funkos. - # + # # This doesn't guarantee that they will be running the latest # version, and it will try to recicle paused and exited containers. - # + # # If there is no other way, it will create a brand new container with # the latest known image and start it. - # + # # If there are no images for the funko, it will fail to bring it up. class Up @arguments : Array(String) = [] of String @@ -93,9 +93,6 @@ module Faaso def run funkos = Funko.from_paths(@arguments) funkos.each do |funko| - container_name = "faaso-#{funko.name}" - docker_api = Docr::API.new(Docr::Client.new) - if funko.image_history.empty? puts "Error: no images available for #{funko.name}:latest" next diff --git a/src/funko.cr b/src/funko.cr index 52cebb8..7ca781a 100644 --- a/src/funko.cr +++ b/src/funko.cr @@ -107,7 +107,7 @@ class Funko end # Create a container for this funko - def create_container( autostart : Bool = true) : String + def create_container(autostart : Bool = true) : String conf = Docr::Types::CreateContainerConfig.new( image: "#{name}:latest", hostname: name, @@ -127,7 +127,7 @@ class Funko docker_api = Docr::API.new(Docr::Client.new) response = docker_api.containers.create(name: "faaso-#{name}", config: conf) response.@warnings.each { |msg| puts "Warning: #{msg}" } - docker_api.containers.start(response.@id) if autostart + docker_api.containers.start(response.@id) if autostart response.@id end end