Query containers using the most recent API version
This means we will also get the Config section with env vars
This commit is contained in:
parent
dd091041b8
commit
6bcb31da98
|
@ -4,9 +4,14 @@ from restic_volume_backup.config import Config
|
|||
|
||||
|
||||
def list_containers():
|
||||
"""Easily mockable container list"""
|
||||
"""
|
||||
List all containers.
|
||||
|
||||
Returns:
|
||||
List of raw container json data from the api
|
||||
"""
|
||||
config = Config()
|
||||
client = docker.APIClient(base_url=config.docker_base_url)
|
||||
all_containers = client.containers()
|
||||
client = docker.DockerClient(base_url=config.docker_base_url)
|
||||
all_containers = client.containers.list()
|
||||
client.close()
|
||||
return all_containers
|
||||
return [c.attrs for c in all_containers]
|
||||
|
|
Loading…
Reference in New Issue