Backup docker containers before installing update and allow rollback


Recommended Posts

Sometimes an update kills a docker container. A good example is the InfluxDB container. The InfluxDB team changed the location of the database from  /var/lib/influxdb to /var/lib/influxdb2 and the unraid template maintainer missed this part, so updating this container removes the files from appdata. But there are other examples like the MariaDB 10.6 update which broke several Nextcloud installations.

 

 

Of course everyone should create backups, but most of them work only on daily basis on not exactly at the time when the user hits the update button

 

My feature request:

- a user hits the update button

- unraid reminds the container version

- container is removed

- appdata folder files of this container are copied on the same disk/pool through "cp --reflink=always /mnt/diskX/appdata/containername/ /mnt/diskX/appdata/containername-<containerversion>-YYYYMMDDTHHIISS/" (reflink guarantees, that it won't consume (much) additional storage space)

- recent container images are installed

 

Now the user gets a note that he is able to rollback for the next three days. The rollback can be started through the usual container menu. If a rollback is done, the container repository name is automatically set to containername:<containerversion>.

 

 

 

 

  • Upvote 10
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.