Close socket from container to server when killing the container in order to save run output

This commit is contained in:
Maximilian Grundke
2018-06-05 17:10:22 +02:00
parent 7d6f2f09ff
commit 90d1dcdc37

View File

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