Mount backup volumes into the backup process container

This commit is contained in:
Einar Forselv 2019-04-19 02:18:32 +02:00
parent 64908c8e2f
commit 196c59962b
1 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import argparse
import pprint
import sys
from restic_volume_backup.config import Config
@ -59,10 +60,19 @@ def backup(config, containers):
restic.init_repo(config.repository)
print("Starting backup container..")
# Map all volumes from the backup container into the backup process container
volumes = containers.this_container.volumes()
# Map volumes from other containers we are backing up
mounts = containers.generate_backup_mounts('/backup')
volumes.update(mounts)
pprint.pprint(volumes, indent=2)
backup_runner.run(
image=containers.this_container.image,
command='restic-volume-backup start-backup-process',
volumes=containers.this_container.volumes,
volumes=volumes,
enviroment=containers.this_container.environment,
labels={
"restic-volume-backup.backup_process": 'True',