Lost all my work in a docker instance

The benefits of volumes discussed above are definitely clear. However, it is usually a good idea to have proper backup strategies in place for your development. The backup method I prefer for most scenarios is utilize a bind-mount into the container as a target for the scheduled gateway backups within Ignition. By providing a bind-mount of -v /path/to/backups:/backups combined with configuring scheduled backups (Config->System->Gateway Settings in the Gateway webpage), you can easily have those backups piped back to your host system.

If you need to backup the volume itself, usually you can just use another disposable container using the --volumes-from argument to enable tar’ing up the volume contents. It is a bit of an advanced exercise, and I’d only really recommend this technique if you need to move volumes from one system to another. Thankfully, Ignition has a great scheduled backup function built-in, and it helps guarantee write consistency that might be problematic with the volume export (if the container is still running).

Hope this helps!

Kevin C.

3 Likes