I am trying to setup a restic job to backup my docker stacks, and with half of everything owned by root it becomes problematic. I’ve been wanting to look at podman so everything isn’t owned by root, but for now I want to backup my work I built.
Also, how do you deal with some docker containers having databases. Do you have to create exports for all docker containers that have some form of database?
I’ve spent the last few days moving all my docker containers to a dedicated machine. I was using a mix of NFS and local storage before, but now I am doing everything on local NVME. My original plan was having everything on NFS so I would worry about backups there, and I might go back to that.
I have a backup-script (running as root) that
I had this before but this created struggles with some containers since they do start specific checks and scans during startup which resulted in high cpu and disk load.
Since unraid supports zfs, i am using this for the docker stuff and do snapshots to external disk as backup
no need to stop containers anymorw
If you work with databases it’s still safer to stop incoming data for the time of the backup. I don’t know why a higher CPU load would be a problem, those checks don’t run long or do so much your system would be under much stress. Do your backups at 3am if you still think the minute of highe load would cause any problems.
A simpler method would be to stop/start the Docker daemon instead of containers, it works smoothly.
Have a look at https://github.com/minituff/nautical-backup, it does a similar thing