Files
codeocean/lib/docker_container_mixin.rb
Sebastian Serth fae60a21e5 Sync DockerClient with DockerContainerPool
Fix failing specs after upgrade
2020-09-28 16:53:15 +02:00

17 lines
369 B
Ruby

module DockerContainerMixin
attr_accessor :start_time
attr_accessor :status
attr_accessor :re_use
attr_accessor :execution_environment
attr_accessor :docker_client
def binds
json['HostConfig']['Binds']
end
def port_bindings
json['HostConfig']['PortBindings'].try(:map) { |key, value| [key.to_i, value.first['HostPort'].to_i] }.to_h
end
end