3

I have the following scenario: Host with running docker on it and several containers. Actually i try to create a backup solution for these containers. My actual approach is:

  • Commit containers
  • docker -save

  • stop all running containers

  • make backups of /var/lib/docker/volumes/ with borg
  • start all containers

Now i have the following problem: if i would like to restore the containers, i have to know their entrypoints for volumes and so on. Because with docker save i only got the image itself.

Is there a way, to export these informations from a running system? My goal is to easily restore all containers with their volumes and have the possibility to easily do backups of them.

Host is debian9, 64 bit. Backup target is a local NAS

Thanks Regards

3
  • You could always dump docker inspect output and save it to a file. It won't give you an immediate recovery solution, but all the information you need to start the container again is there.
    – mtak
    Commented Sep 7, 2017 at 8:26
  • Thanks you for your proposal. Looks managable but i thought there would be an easier way.
    – C. Hediger
    Commented Sep 8, 2017 at 5:28
  • Is there a specific folder under /var/lib/docker which contains these container informations? Cause if i copy the whole docker folder from the old server to the new one, i am be able to just run all containers without any changes, out of the box.
    – C. Hediger
    Commented Sep 8, 2017 at 16:20

1 Answer 1

2

Take a look at https://github.com/Red5d/docker-autocompose It might not generate everything that you have on your Docker host (volumes for example), but it will generate a pretty complete compose file for a single container.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .