Thursday 1 December 2016

Tidy up unRAID Docker folders


Since the latest unRAID update introduced the /mnt/users/docker share, my Docker files seem to be all over the place. I have some there and some in an /appdata share which seems to have scattered them on across the cache and the array.

I wanted to update all my Dockers to use the new /docker share and this is what I needed to do.
It turns out it's not just a matter of updating the AppData Config Path field for each docker - it doesn't seem possible to do that for an installed Docker, (changes don't stick). Instead, it's necessary to go through the worrying process of removing the Docker and reinstalling it!

Here's the steps I followed;

0. Ensure the Community Applications plug-in is installed
1. Backup all Appdata contents
2. Stop Docker
3. Set Docker Storage location to /mnt/user/docker
4. Set Default Appdata storage location to /mnt/user/docker/appdata
5. Start Docker but stop any containers whose config path you need to change.
6. Copy the existing contents from /mnt/user/appdata/ to /mnt/user/docker/appdata/
7. Delete the old/soon to be redundant /mnt/user/appdata/. (I also removed the share as I wouldn't need it anymore)
8. One by one, on each docker to be reset, click the remove menu option and confirm that you want to remove the image as well
9. Go to Community Applications, click on the 'previous apps' button, find the docker you just removed and click the reinstall button
10. In the template screen, enter the correct appdata path (usually under 'advanced settings')
11. Apply. Rinse & repeat for each container

When the containers restart, they should all now be pointing to the /docker share.
One interesting nugget I've picked up over the past while - unless files are in the appdata folder, they don't survive even simple container updates. For example, I like nano as my text editor but any update of my Apache or any other container requires me to re-install it again.

No comments: