def _GetAllLingeringContainersInfo(docker_client, prefix):
  """Lists all the stopped App engine containers.

  Args:
    docker_client: an object of docker.Client class to communicate with a
        Docker daemon.
    prefix: str, the container name prefix we are looking for.

  Returns:
    A list of container_info dictionaries.
  """
  all_containers = docker_client.containers(all=True)
  # We roundtrip to the client as 'Status' is only a human readable string.
  live_containers_ids = [container_info['Id']
                         for container_info in docker_client.containers(
                             quiet=True, all=False)]

  def IsPrefixedAndStopped(cinfo):
    return any(
        name.startswith('/' + prefix)
        for name in cinfo['Names']) and cinfo['Id'] not in live_containers_ids

  return filter(IsPrefixedAndStopped, all_containers)