CasaOS
CasaOS copied to clipboard
[Bug] CasaOS 0.4.6 update reverted my --data-root config
Describe the bug
I followed these instructions: https://wiki.casaos.io/en/guides/move-docker-images-and-volumes-to-a-diffferent-storage to change my data-root location. It worked fine for months until I updated to 0.4.6, then the file /lib/systemd/system/docker.service was reverted to default version. This should not be a version related issue, but I wanted to be clear.
To Reproduce
Have a version prior to 0.4.6 installed with unmodified /lib/systemd/system/docker.service, then follow the instructions and add the --data-root. Then update to 0.4.6, and you see the --data-root now is gone.
Expected behavior
I expect it to not revert /lib/systemd/system/docker.service to the default version.
The reason this happened is that the instructions you followed were incorrect. I pointed that out in the Discord server a while ago: https://discord.com/channels/884667213326463016/1163133627291422770/1163133627291422770 and while some of the issues I mentioned were fixed, the one you stumbled upon was not.
File /lib/systemd/system/docker.service is provided by the Docker developers and as such any changes to it will be overwritten upon Docker update - the instructions on the Wiki point that out.
Of course, they then proceed to tell you to edit that file - you should not do that. Instead, you should run sudo systemctl edit docker to create an override file and open it for editing, and then replace its contents with:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --data-root /path/to/new/location
I really hope they will fix the wiki properly this time.
That makes perfect sense. Thank you for the info.