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.
All Docker containers have their persistent data in Docker volumes located on a BTRFS mount. A cronjob takes a snapshot of the BTRFS volume, then calls
btrfs send
, pipes that throughtar
andgpg
and then directly to AWS S3.Great idea. I already do something similar(minus the btrfs part) for Vaultwarden. Mind sharing the script/commands?
I setup my host with btrfs but I have 0 knowledge of it so I didn’t take advantage of it until now. I already have my docker volumes mapped to /docker/stack so I’m gonna create a sub-volume and move that there.
I’m mostly interest in your btrfs snapshot and send commands but if you don’t mind sharing the whole thing that would be great.