I'm currently running Docker 1.12.6 on Ubuntu 17.04, and I would like to know if all directories under /var/lib/docker should be included in my monthly backup (I backup everything under / with rsnapshot
, and then set some exclude
rules).
With Vagrant, for example, I exclude from the backup downloaded images and their resulting machines (.vagrant.d/boxes/ and .VirtualBox/Machines/), since they can be rebuilt anytime with their respective Vagrantfile.
I don't really understand how the /var/lib/docker
directory structure works, though. It is like the following in my system:
# tree -L 2 -a -F --dirsfirst --noreport /var/lib/docker/
/var/lib/docker/
├── aufs/
│ ├── diff/
│ ├── layers/
│ └── mnt/
├── containers/
├── image/
│ └── aufs/
├── network/
│ └── files/
├── swarm/
├── tmp/
├── trust/
└── volumes/
└── metadata.db