Docker Troubleshooting Rebuilding the Unraid Docker Image

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys and welcome to another video so in today's video we're going to be looking at a common problem where you may find you have to recreate your docker image so if that sounds interesting let's get started okay so this video is about a common docker problem where the docker image can become corrupted and so we need to delete it and recreate that image now don't worry this isn't actually as bad as it sounds the docker image is basically like a v disk which stores all of the docker images which the unread docker service uses but this is non-persistent data and by non-persistent data i mean not like the user data that's in to do with that container for example plex it's not the movies it's not the watch history or even the settings that you've put in that is all persistent data which isn't stored in the docker image and we can see an example of that in action if we head across to the server and go to the docker tab and here we can see that mb needs an update so if i click on apply update here we can see here it's pulling down all the various layers and with these layers it will update the whole docker image making a new image for this particular container looking here we can see it's removed the mb container then it spins up another container and then removes the orphaned image is left behind so each time we update a container that whole container is actually removed and recreated so each time you update a container it totally removes the old one and creates a fresh one and any updated container of course it doesn't lose any of your user data everything runs exactly as it did because the docker images don't contain any persistent data all of that persistent data is either going to be in your app data or in one of your other unread shares so any container on the docker page that you either update or even remove it won't remove any of your important data it will just remove the container itself and all of these docker containers and images are stored and unraid in a specific location which we can see if we go to settings and then docker here so all of your non-persistent docker containers and images are stored in this location here and by default in unraid this is in a butter fsv disk and some of you might be asking what is a buttrefs v disk well butterfs or btrfs is a file system and a v disk is a file which is a virtual disk and so all of our containers are stored here and just like when we removed a container it doesn't get rid of any of our persistent data removing the whole docker v disk that doesn't get rid of any persistent data either and if we do delete our docker vdisk it's easy to recreate everything and be back up and running in no time now you might be thinking just why would we want to delete this image anyway and what can happen sometimes as this file becomes corrupted which can cause either individual containers not to start or the whole docker service not started so let's look at what these errors might look like for an individual container you might go to start it and you see an error like this saying execution error server error but this error isn't necessarily a docker image problem you can also get this error if you've added a new container and it's trying to use the same port as what another container uses you'll also see this error so before you go recreating your docker image just check the basic things like that first so you've checked that and there's no conflicting ports and go back to settings docker in the top right here toggle to advanced view scroll right down to the bottom check this tick box here where it says correct file system errors and run a scrub on the docker image once that's done go back to the docker tab and try starting the container again and if you still get the same error in the top right hand side toggle across from basic view onto advanced view here then clicking on force update here will cause the container to be recreated sometimes this can help so let's put it back to basic view and try starting the container again okay this time it's working so it looks like it's all good okay but what if it doesn't work when you came back here to start it again we got the same error well this time what we can do is we can take it one step further we can click onto the container click on to remove make sure we've got this ticked also remove image click onto yes delete it that will remove the whole container now we can easily add it back by going to the bottom here clicking on add container where it says template here click on select a template and choose the container you just removed and for those of you who are interested this works because unraid stores all of your filled out templates on the flash drive in the folder config plugins command templates user so this is the location where unraid stores all of your filled out docker templates whether the container is still installed or not so if i click on bin hex crusader here it's going to fill in the template exactly as i had it before so with that done i'm just going to click apply so now this is downloading the container again fresh so with any luck maybe it will fix the problem okay so with that done i can see that the container is running there's no error so far so let's open the web ui and take a look and crusaders working fine but if you weren't lucky and it hadn't fixed the problem and you went to start the container and you're getting the same error well probably the only thing we can do then is try rebuilding the docker image so as well as having problems with individual containers we can also have problems with the whole of the docker service that looks like if we click onto docker it will say the docker service has failed to start and going to settings here and going to docker we can see the docker service is enabled but we can't start it and again before doing the nuclear option and deleting the docker file do some basic checks turn off the docker service and then turn it back on to restart it and if after doing this the docker server still fails to start well it's worth just trying to restart the server and if after a restart we go back to the docker tab and it's still the same well i think it's time to remove the whole docker image and rebuild everything so to recreate the docker image we need to go to settings here then docker and we need to turn off enable docker we need to set that to no now under the section here dr vidis location on the right hand side here we're going to check delete vdisk file with that done the button here turns to delete we need to click that and that will remove the docker image okay so the docker image is deleted now and we can tell there's no image here because there's well no button to delete it so now enabling the docker service will recreate a new docker image but if we want to now's a good time if we wanted to up the size of our docker image we can specify the size here before starting the service and it will make the docker image that size so i'm going to make it a little bit bigger and make mine 30 gigs okay so now i'm going to start back up the docker service by clicking yes and then clicking apply so with that done if we go back to the docker tab here well there's no error now but hey all your containers have gone well don't worry that's perfectly normal we can easily recreate all of the containers that we had before and there's two different ways to do it there's the manual long way and this easy automatic way so we'll start with the manual way because we kind of looked at that earlier when we're doing our troubleshooting steps we can click here where it says add container and where it says template here so just like before clicking select a template shows all of the containers that have previously been installed on your server so again i'm going to click on bin hex crusader here we can see here that the template is fully populated so clicking on apply will pull down the container with the original template and install a container into the fresh new docker image that we just created and that container is working just as it did before so we could go through and install each individual container this way or we could do it the easy way and use squid's excellent community applications which has this feature built in okay so let's go across to the apps tab here now on the left hand side here if i click on installed apps here and then i click on docker to filter just the docker containers that are installed i can see binhex crusader that i installed just a moment ago but clicking here onto previous apps and again filtering to docker by clicking on docker here are all of the previous containers that i had installed on the server and again community applications knows what containers you had installed because the templates of previously installed containers are kept on your flash drive put in the check box next to each container you want to install or to choose all of the containers at once just select all on page here then to reinstall your selector containers just click on install selected applications here and when prompted click yes install them that will pull down all of the containers and reinstall everything back to how it was now obviously this can take some time so i'm going to fast forward this and skip forward in time to the end to save you getting bored watching that hey doc brown what are you doing here i said you could be in the last video about mac os and time machine because that well it kind of seemed relevant when this baby hits 88 miles per hour you're gonna see some serious no doc seriously this is meant to be like a semi-serious youtube channel you can't just turn up every time i say i'm gonna speed up and go forward in time people are gonna get really fed up with lame jokes like that you know i bet there's even people in the comments now saying hey that's just not funny space invader get back on track okay okay sorry about that so when all of the containers have downloaded just click onto the done button here and then if we go back to the docker tab so here we are all of the containers reinstalled into the fresh docker image and everything's working perfectly no date has been lost at all and just to prove that let's open up envy here it's running perfectly and if i log into a user here safe now everything's led line doc brown you sneaky little i told you not to come back into this video they found me i don't know how they found me okay guys what can i say with that i think it brings us to the end of this video anyway guys if you liked it please hit the like button subscribe to the channel share with anyone who you think might also find it useful and i'll catch you in the next video
Info
Channel: Spaceinvader One
Views: 19,148
Rating: undefined out of 5
Keywords:
Id: WXBB4I0iLZM
Channel Id: undefined
Length: 11min 14sec (674 seconds)
Published: Sat Aug 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.