Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Solved] Restore Docker settings after docker.img deletion?

Featured Replies

For some reason my cache pool got corrupted today (thx 2020) and I ended up with using btrfs restore, format and restore the pool. When I tried to start the Docker service again got the following message:

Quote

Your existing Docker image file needs to be recreated due to an issue from an earlier beta of Unraid 6. Failure to do so may result in your docker image suffering corruption at a later time. Please do this NOW!

So I deleted the docker.img-file, started the service and I'm currently adding the containers from my templates.

 

However it seems that my Docker network settings are gone and therefor a few containers can't run properly because of missing my custom network types.

Is there a way to restore these network settings, or at least a way to recreate it? Also it would be nice if I can get my hands on the metadata of the Docker containers such as autostart settings etc, but the main part is networking settings.

Edited by walle
Mark it as solved

  • Community Expert

The custom docker networks need to be recreated the same way you created them originally. Once the custom networks exist your templates will use them. How did you know what to do when you created them before?

  • Author
25 minutes ago, trurl said:

The custom docker networks need to be recreated the same way you created them originally. Once the custom networks exist your templates will use them. How did you know what to do when you created them before?

That’s the basically the issue, I don’t remember what networks I did setup and what guides I followed. I will probably able to figure that out soon as I get some sleep (currently 4 am). I still have the corrupted docker.img, so if it’s possible to recover the information from it I will give it a try.

 

Also, if there is a way to back up Docker metadata other than backup docker.img file, let me know. Or if it’s ok to back it up anyway even if it’s mostly unnecessary and space inefficient to do so.

  • Community Expert

You can examine the template XML of each of your dockers to see the name of the custom network it was using. Your templates are on flash in config/plugins/dockerMan/templates-user 

  • Author
On 1/1/2021 at 4:44 PM, trurl said:

You can examine the template XML of each of your dockers to see the name of the custom network it was using. Your templates are on flash in config/plugins/dockerMan/templates-user 

Yeah, but in my case I also need to know what driver I did use and that's why I needed the network config. But thanks anyway.


Anyhow after another server crash (🤮), fix the most likely cause of the error, recover the data again and lastly fixed mayor issues with some containers I finally had time to reconfigure the networking. It was a bit of a pain, but if this happens again I have now at least metadata backup of the config thanks to this simple scheduled user script I run every night:

#!/bin/bash
BACKUP_PATH=/mnt/user/backup/system/metadata

docker network ls > "${BACKUP_PATH}/docker_network.txt"
docker images --digests > "${BACKUP_PATH}/docker_images.txt"
docker ps > "${BACKUP_PATH}/docker_ps.txt"

Besides the networking info, I also added other useful info that can come in handy such as be able to fetch specific image version instead of try to fix the latest image.

Edited by walle

  • 3 months later...
  • Community Expert

@walle thanks for sharing your script, i will use it. i am not very into scripting.

 

maybe theres a way to backup the Network settings from /mnt/user/system/docker/container/network/ ?

  • Author
1 hour ago, sonic6 said:

@walle thanks for sharing your script, i will use it. i am not very into scripting.

 

maybe theres a way to backup the Network settings from /mnt/user/system/docker/container/network/ ?

Unfortunately no what I'm aware of, all information is contained in the /mnt/user/system/docker/docker.img file and the easiest way to get any meta information from this file is running docker CLI commands. If you read the content of my script, it's basically the same docker commands that you would normally write in a terminal. I don't think there is any similar way than this unless someone either creates a plugin or be part of some backup plugin/tool. Anyhow, just install User script plugin, if you not already have it, and copy paste the script, change path and you are done. :)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.