code: def docker_inspect(image):
      '''Inspects a docker image
  
      Returns: Parsed JSON data
      '''
      args = ['docker', 'inspect', '--type', 'image', image]
      p = Popen(args, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
  
      stdout, stderr = p.communicate()
      stdout = stdout.decode('utf-8')
      stderr = stderr.decode('utf-8')
  
      if not p.returncode == 0:
          if 'no such image' in stderr.lower():
              raise NoSuchImageError(image)
          raise DockerError('Failed to inspect image: {}'.format(stderr.strip()))
  
      return json.loads(stdout)[0f docker_inspect(image):
      '''Inspects a docker image
  
      Returns: Parsed JSON data
      '''
      args = ['docker', 'inspect', '--type', 'image', image]
      p = Popen(args, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
  
      stdout, stderr = p.communicate()
      stdout = stdout.decode('utf-8')
      stderr = stderr.decode('utf-8')
  
      if not p.returncode == 0:
          if 'no such image' in stderr.lower():
              raise NoSuchImageError(image)
          raise DockerError('Failed to inspect image: {}'.format(stderr.strip()))
  
      return json.loads(stdout)[0]
docs: Inspects a docker image
  
      Returns: Parsed JSON data