class HyperDock::Resource::Container

Public Instance Methods

attributes() click to toggle source
# File lib/hyperdock/resource/container.rb, line 22
def attributes
  @attributes ||= container.info
end
container() click to toggle source
# File lib/hyperdock/resource/container.rb, line 8
def container
  @container ||= ::Docker::Container.all.select do |container|
    container.id == request.path_info[:container]
  end.first
  #::Docker::Container.get id
end
networks() click to toggle source
# File lib/hyperdock/resource/container.rb, line 27
def networks
  @networks ||= attributes.dig('NetworkSettings', 'Networks') || {}
end
resource_exists?() click to toggle source
# File lib/hyperdock/resource/container.rb, line 16
def resource_exists?
  !container.nil?
rescue ::Docker::Error::NotFoundError
  false
end
volumes() click to toggle source
# File lib/hyperdock/resource/container.rb, line 39
def volumes
  @volumes ||= attributes.fetch('Mounts') { [] }
end