lib/docker/metrics/container.rb
#Gather docker info from docker remote api
Gather docker info from docker remote api
Gather docker info from docker remote api
def gather_docker_info(require_details)
        container_info = {}
        container = Docker::Container.get(@name)
        raw_data = container.json
        @running = raw_data['State']['Running']
        container_info['Name']= raw_data['Name'].gsub!(/^\//,'')
        container_info['Id']= raw_data['Id']
        container_info['Image']=raw_data['Image']
        container_info['ImageName']=raw_data['Config']['Image']
        container_info['State']=raw_data['State']
        container_info['Config']={}
        container_info['Config']['Hostname']=raw_data['Config']['Hostname']
        container_info['Config']['Env']=raw_data['Config']['Env']
        return container_info
      end
def gather_docker_info ( require_details ) container_info = { } container = Docker :: Container . get ( @name ) raw_data = container . json @running = raw_data [ 'State' ] [ 'Running' ] container_info [ 'Name' ] = raw_data [ 'Name' ] . gsub! ( / ^ \/ / , '' ) container_info [ 'Id' ] = raw_data [ 'Id' ] container_info [ 'Image' ] = raw_data [ 'Image' ] container_info [ 'ImageName' ] = raw_data [ 'Config' ] [ 'Image' ] container_info [ 'State' ] = raw_data [ 'State' ] container_info [ 'Config' ] = { } container_info [ 'Config' ] [ 'Hostname' ] = raw_data [ 'Config' ] [ 'Hostname' ] container_info [ 'Config' ] [ 'Env' ] = raw_data [ 'Config' ] [ 'Env' ] return container_info end
Gather docker info from docker remote api
Gather docker info from docker remote api
require_details