From f97986c0af7cdc868955a97cf600b9cd1da5867e Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Thu, 18 Apr 2019 03:52:28 +0200 Subject: [PATCH] Include env vars in backup_runner --- restic_volume_backup/backup_runner.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/restic_volume_backup/backup_runner.py b/restic_volume_backup/backup_runner.py index ded3f02..3e997e1 100644 --- a/restic_volume_backup/backup_runner.py +++ b/restic_volume_backup/backup_runner.py @@ -5,17 +5,18 @@ import docker from restic_volume_backup.config import Config -def run(image: str = None, command: str = None, volumes: dict = None, enviroment: dict = None): +def run(image: str = None, command: str = None, volumes: dict = None, + enviroment: dict = None, labels: dict = None): config = Config() client = docker.DockerClient(base_url=config.docker_base_url) container = client.containers.run( image, command, - labels={"restic-volume-backup.backup_process": 'True'}, + labels=labels, auto_remove=True, detach=True, - environment={}, + environment=enviroment, volumes=volumes, working_dir=os.getcwd(), )