Include env vars in backup_runner
This commit is contained in:
parent
a5480fd645
commit
f97986c0af
|
@ -5,17 +5,18 @@ import docker
|
||||||
from restic_volume_backup.config import Config
|
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()
|
config = Config()
|
||||||
client = docker.DockerClient(base_url=config.docker_base_url)
|
client = docker.DockerClient(base_url=config.docker_base_url)
|
||||||
|
|
||||||
container = client.containers.run(
|
container = client.containers.run(
|
||||||
image,
|
image,
|
||||||
command,
|
command,
|
||||||
labels={"restic-volume-backup.backup_process": 'True'},
|
labels=labels,
|
||||||
auto_remove=True,
|
auto_remove=True,
|
||||||
detach=True,
|
detach=True,
|
||||||
environment={},
|
environment=enviroment,
|
||||||
volumes=volumes,
|
volumes=volumes,
|
||||||
working_dir=os.getcwd(),
|
working_dir=os.getcwd(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue