Merge pull request #177 from openHPI/parse-errors-on-stop

Parse runtime output on stop
This commit is contained in:
rteusner
2018-06-14 13:14:34 +02:00
committed by GitHub

View File

@ -186,11 +186,12 @@ class DockerClient
end end
def self.destroy_container(container) def self.destroy_container(container)
@socket.close
Rails.logger.info('destroying container ' + container.to_s) Rails.logger.info('destroying container ' + container.to_s)
container.stop.kill container.stop.kill
container.port_bindings.values.each { |port| PortPool.release(port) } container.port_bindings.values.each { |port| PortPool.release(port) }
clean_container_workspace(container) clean_container_workspace(container)
if(container) if container
container.delete(force: true, v: true) container.delete(force: true, v: true)
end end
rescue Docker::Error::NotFoundError => error rescue Docker::Error::NotFoundError => error