restic-compose-backup/restic_volume_backup/utils.py

13 lines
299 B
Python
Raw Normal View History

import docker
2019-04-15 17:49:57 +00:00
from restic_volume_backup.config import Config
def list_containers():
2019-04-16 00:22:23 +00:00
"""Easily mockable container list"""
2019-04-16 16:22:03 +00:00
config = Config()
2019-04-17 01:45:51 +00:00
client = docker.APIClient(base_url=config.docker_base_url)
all_containers = client.containers()
client.close()
return all_containers