Docker - New Device ID when Container is restarted or updated?

Hi everyone!

I’m running syncthing in a Docker container (syncthing/syncthing) on OMV and after setting everything up it worked as expected.

But - after pulling a newer docker image from docker hub and/or restarting a container, the device ID for my OMV NAS is created new which means that I have to setup all shared folders on all connected devices again.

The config directory for docker syncthing is on a persistent path (not on a docker volume) and I thought that this means, that all configuration data is persistent as well. So - why do I get a new device ID when I restart the container or pull a new docker image?

What am I doing wrong?

Best regards BartManson

It’s clearly not persisted, as it generates a new id on every startup.

This question is beyond syncthing, and you should seek for help with docker (use volumes).

Thanks for your answer Audrius!

But - the syncthing server does still know the shared folders and all other settings after pulling a new docker file or restarting the container. Why is a new device ID created and all other settings are the same as before the pull or the container restart?

Does anyone else have this behavior in docker syncthing?

Best regards BartManson

No, I don’t see that problem with Docker. Post the commands you are using to run the container.

OK, I think I solved it. It seems to be related to OMV’s docker plugin. If I update the docker image or restart the container via the plugin, then it seems to create a new device ID. If I update it via this script:


docker pull syncthing/syncthing docker stop syncthing docker rm syncthing

docker run -d --name=syncthing --restart=always -e PUID=1000 -e PGID=100
-e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-v /home/syncthing/config:/var/syncthing/config -v /srv/dev-disk-by-label-data:/var/syncthing
–network=syncthing -p 22000:22000 -p 8384:8384 syncthing/syncthing

… then the device ID stays the same …

User syncthing (uid 1000, gid 100) has access to /home/syncthing/config where the config files are stored persistently. The network “syncthing” is a bridged network that is used by syncthing only.

Thanks for your kind help!

Best regards BartManson

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.