All about Docker in unRAID. Docker principles and setup

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys and welcome to this week's video today it's all about docker in that raid what is it how to get it set up some starters and how to avoid common mistakes so let's get to it so today we're going to be looking at docker in our raid and how best to use it we'll break down the top to get an 8 basic section what is docker how to enable docker about the docker image files app data what it is and how it relates to Dockers how to install the dakka dakka volume mapping principles keeping things consistent across your Dockers finally common docker problems so let's start with what actually docker is and how they are different to the EM they basically do act like virtual machines but they are actually self-contained processes so we've got our server hardware on top of which runs our host OS and for us that Sun raid docker is then installed sitting on top of that which then allows the containers to run on top of the docker and our daughter container contains an app along with all its dependencies needed and for those of you who are not sure what dependence we've actually are they are all the other things an apple program needs to be able to run nothing to the game on a Windows computer it needs DirectX to work DirectX is a dependency for that game so it's just the same as that so the app and its dependencies all run together in an isolated environment inside the container the containers all use the same resources with the host OS they all sit on the Linux kernel and they use the same CPU and RAM etc and the cool thing about Dockers is of that built-in layer they all have a base layer that they work off and the layers on top are the various dependencies of that docker and the docker engine will only download two layers but it doesn't already have so if you already have another docker that uses the same layer you don't need a second copy of that layer so all of the shared layers are read-only and it's only the top layer which is writable so this is very efficient on Meg stock is very lightweight so let's compare a DM and a docker now one of the em the VM separates the operating system from the bare metal hardware it's running on by virtualizing the hardware but the docker separates the application from the OS it's running on by virtualizing the OS by this I mean let's take running an app on a VM let's look at a common app many on raise users use let's look at Plex now we can build a Windows VM on our server and install Plex on that VM and with any dependencies Plex may need to run of course this have worked but it would be a heavy app maybe 30 or 40 gigs now if you want another 2 app separate to flex what happens for example we want Open VPN and transmission BitTorrent client but we'd need to separately ends so now that's bringing our total size up to 90 gigs now just for 3 apps remember we always have to bring the OS with us yes we could run all those apps on one via but then they're not separated from each other and when we're running an app on a VM remember we were using one operating system the base operating system here and then we're running our guest operating system here the windows and also we're running another layer which is the hypervisor which is emulating all of the hardware so there's a lot of heavy lifting going on now let's take the same app as a docker now docker as I said fertilizes the operating system and puts the app on top of that so docker kind of standardizes the OS by making it virtual in the same way at the end standardized of the hardware by making that virtual this allows the app to be packaged with its dependencies in a container and not have to worry about the OS underneath so our Plex Open VPN and transmission torrents I'm not having to carry and run an OS wisdom to work so it makes some very lightweight and very efficient this way so that's a very basic overview of what docker is and the differences and similarities to the VM so now let's move on to installing docker on our host OS I'm rage okay so let's start with how to enable our daughter service so what we need to do is once on the unread GUI click on the tab here saying settings and there you see the little dropper icon click onto that and here you'll see an option saying enabled offer you can toggle that on and off so make sure it's on yet and then just click apply ok and now having clicked apply you can see here it says status was running to the dock service was running and you'll also notice here at the top is another tab now saying dropping so that's how we enable docker a run rate so now let's talk about the docker image file we go across to the right here you'll see we're looking at basic view so let's click this on to the bar and now you can see there's some more information about doctor we've got our double version here I'm hearing for our docker storage locations and this is where the docker image file is stored and at the moment it's stored in our system share so if I click on to my shares here here's my system share and so in this share in this folder here here's my docker image file and you see the size of it is 21.5 gigabytes and we can change the size of this by default it's set for 20 gigs so if we go back to our settings and we click on to docker again so when fact looking at the docker settings you'll wonder where anything is interviewed the be this size for the docker so what we need to do is we need to actually stop the docker service to be able to see them so click on to know and then click apply and now you can see here it says the dock of a disc size and by default it's set to 20 gigabytes now why would you want to increase the size of this well the docker image file stores all of your doctor images and so the more doctors you have the more size that you'll need and for most people 20 gigs is absolutely fine if you have a lot of Dockers the docker image file might get for that and so you're going to need to increase the size this so to do that all you do is just put in the size you want I know typing 25 gigs here and click apply and then just start the buccal side biscuit and click apply and now you'll see if you go back and look inside the share you see now that it says the size of twenty six point eight gigabyte now one thing to note is you can't actually shrink the size of the docket image file so you may think well I can just type in 20 and click apply yes it looks like it has gone to 20 and we can start the docker service again and you might think everything's fine but let's go back to shares and as you can see the docket image size is still the twenty six point eight gigs here and if we go back to our settings and stop the dock the service it said here that it's 20 gigs so don't try and make it any smaller because it will mess up what it says for your docker be disk image size and it won't be correct so we can't shrink the vbus size for the doctor but what we can do is we can delete it by checking this box here and then clicking delete and then we can recreate it at a different size say 15 gig and click apply and then we start the docker service and now if we look at our share you can see the docker image size now has 16 point 1 gig now I want them to remember that if you try and do this when you've already got Dockers installs inside the image you will lose all of them but they're fairly easy to restore and we'll be looking at that later on in the video okay so that's the docker image file now let's move on and talk about app data our app data is exactly what it says it is if the data folders and files for each car that the doctor uses to run it's all of its configuration files etc that are needed for that particular doctor functions so let's have a look at the docker settings tab again so you can see where their app data folder is located we can see that the default storage location is in our user shared in app data so let's have a look there so here's the app data folder and by default if you have a cache drive this is automatically created on the cache drive now this is good because it gives far better organs but if the updater is desperate on the mobile array on this server will know doctors installed as yet they look at the app data folder it's empty and let's go across to my main server ones Glen to adoption school and this is the app data folder here as you can see all of the different doctors are having sort of their own separate folder and inside each folder all the configuration files for that doctor and located here having the app data outside of the docker image make sense because it prevents a docker from creating lots of data inside the docker image file we don't want that because it will just get full and cause problems when a docker can access specific data outside it's called volume mapping and the app data is an example of docker volume mapping which we'll look at in detail after we first see the best way to install a docker if we click on the blocker tab on my test server you'll see there are no installed Dockers here let's compare that to my main server where there are lots so the Dockers tab displays all of our doctors and we see the button here ad container well don't press it that's the old difficult way to install the docker nowadays we use squids excellent community applications plug-in which is absolutely awesome let's install it first we need to go to the Lion tech forums and scroll down until you come to plug-in support click on that and if you see in the top sticking part here you'll find the plug-in community applications click on that and scroll down here and you need this line of code here so just copy that and go back to our server and click on plugins and then click this tab here install plug-in and then just paste and just paste the code into here and click install and now the community applications is installed and now look at the top here we have a news tab and it said apps so if we click onto that from here we can install all of the doctors that are available to the community ok so let's have a look at our community applications we've got some tabs across the top here available apps installed apps pretty a sack and pins out well as it's not much installed on this server let's go across to my main server and have a look there so as you can see here of the packs and on the available apps everything splits up into sections so if you're looking for a media server you can click on some media servers and then community applications will filter out from all of the apps available all of the various media servers you can install they are moving along to install that clicking on this this will lift all of the installed apps that are on your server at present and this tab here previa facts this will list all of the previous apps that you have installed on your server in the past so should you want to reinstall the doctor you've had on before you can just click reinstall here and this tab here pinback this is where you can pin an app to install later on so if we go back to our available apps here and we see this little button here is a red button on each R so say I'm scrolling through all of the Dockers and I think by list up to the interesting doctor I'd like to install I can just click on here and it will pin it into this section here and let's do the same in this one so now when we go to pinned applications as soon as three applications here so it's a bit like kind of having a basket on a shopping cart so you can just add everything together that you want and across over here there's a button saying resource monitor if we click on for this it basically tells us what the sources for was i running doctors are using i've only got four doctors running at the moment what it shows you is how much CPU each stop is using and how much memory it is using and if you click on here to calculate app data size you can also see how much space they're using in your app data folder this can be used with us for tracking with all of your doctors are doing so let's go back across to the other server and install the docker ok so let's choose a docker to install let's look in the media servers tab and we'll install this one here the NV one so all you have to do is click on the Add button underneath it and this brings you to the docker template for the chosen docker on this page we can map those ports to the docker and we can map volumes to the dock and to see an additional mapping if we click the show advanced settings here we can see the bits map to the AppData folder and that's the configuration files for this docker but before we go ahead and fill this canto tin let's talk about doctors volume mappings okay so what is doc of volume mapping and why do we need to do it so let's take a docker and in our case we'll take envy well by their nature doctors don't have persistent storage so what this means is when we shut them down everything basically goes so what we do is we map shares on the server to the container to allow it to have reading write access to persistent storage but we only give the container access to things of the needs and obviously the containers been spared to need to read and write its configuration data and this is automatically mapped over to the updater by default in one way that's not something we actually have to set ourselves but because NV is a media endpoint you want env to be able to have access to our media so it can play it back it's an app that share because the doctor needs it so the doctor doesn't need access to the downloads or the work data in fact the container doesn't even know they're there it doesn't even know the share we have allowed to be marked I'm not a part of itself in case app data is forward slash config and if it's a media share is /media in its own file system as far as the doctor is concerned because the only thing running on the server we can also map ports the Dockers to enable them to have a network connection to communicate and by default these are second the template itself and there's normally no reason to either have to change me the only time you might have to change them is if we have two Dockers we've use the same port number in that case we have changed the port number on the house to forward from a new port but it would still be back to the original port number inside the container okay so now we understand that let's go back to our template and fill it in there okay so let's start at the top and work down first thing we come to here is to contain the pause you can see it's 8 0 9 6 so like I said normally we don't have to change the house port at all but what we can do is if you scroll down here you see this button here it says show deployed host pause well if we click on that it will show which ports are in use on the server and I don't have any other docket installed on here it's blank at the moment let's go across to my other server and if on this template here I click on the show deployed host ports then the template I'm working on this highlight has been read here and the port number 8 0 8 0 and I can look through all the other port numbers of the other Dockers and I consumers no conflict so I know I don't need to change this to anything else ok and so the next bit here is to contain the past the /media so this is where I'm be looking for the media and at the moment is set for /mnt /user and that's all of the user shared on the server personally I don't like doing that because I prefer my daughters only to have access from where they actually need but it is fine to have this and it will work this way but I suggest using a direct path to the show you me so to change this just click on here and then scroll down to the share that you want I want to have media files Maximus and click on the share you want and then this is for slash media will point to this location now and if we scroll down here we can see the updater config path again this is only visible by clicking this button here to show the advanced settings and config file is just map to the updater share and it's put in a folder called in hex - MB so that's a CEM cake filled out so just all you have to do then is click apply and then it will pull down all the layers of the socket that it needs and install it on your forever and when it's finished let's click on the done and it brings you back to this screen you don't need to click anything on this screen just ignore this and then click back onto docker and you can see them at the env Dockers installs and running and here you can see the port mappings for that docker and it shows you where the ports are mapped to like here it's mapped to my server IP address which is 1010 got 20 but 1 9 8 and the volume mappings are here you can where media is map to and you can see where the conflicts map to and another useful button here is it also start if you click this on sir on every time your server starts this docker will automatically start and we can see here that the basic view we can actually toggle it on to an advanced view and when we're on this advanced view you can actually force an update of the docker by clicking on here and it gives us a little bit more information about your application okay one thing you want to try and do is keep your volume Maxim's consistent across all your talk is if we go across to my on the server all of my volume mappings are pretty much the same everywhere I've got a data folder the Downloads which map to the Downloads folder and that's the same for all of my different Dockers if we wanted to lose for instance you can see that the Downloads folders go to data and then incomplete so that data folder here is mapped to my downloads so that relates the Downloads learning complete and so when they're completely then moved to the Downloads chair and then forward slash tolerance and then let's look at my fab and DVD temporary downloads folder is forward slash data and forward slash incomplete so the forge past data is maximum downloads and the completed folder is /data /index it rage again one of my post-processing directories and /data /nostart the downloads and then the forward slash complete is where my completed download bar so always try and keep things consistent in case other Dockers communicate with each other and they're trying to find where files are okay now we'll just go through some common problems people tend to have the docket you may find that you have a docker that create some files on the or array and are unable to modify them or delete them let's take fab as an example this download then PBS on to your array what we have to make sure is the permissions to completely download a set to seven seven seven so that gives everyone read write and execute permission so in the doc you're having trouble with if it's not flat then try and find the part or it gives you the options to change the permission to 770 you're finding that over time the docker image keeps getting for that even though you're not actually adding extra docket this is often because the mappings inside the docker are incorrect as adding files inside docker image itself let's take stab as an example of this so in south for example is a temporary download folder and there's a completed download folder now at the moment both of my directories are correct they're mapped to /data incomplete and /data complete and the forward slash data is mapped to my download share but let's take the temporary download folder for example and I'll show you how it can be incorrectly set let's click on browse and here's all the directories inside of the docker so if I scroll down and I selected say the TMP file click set and then Save Changes all of my temporary downloads are actually going to be downloading inside of the container so this will soon expand the container and fill it up and which'll causes problems but always make sure that your volume mapping is done correctly outside of the docker so guys that brings us to the end of another video if you liked it and found it useful well please hit that like button and if you haven't already subscribed to the channel then please do if you want to support the channel any donation is appreciated which you can do by clicking the donation link anyway guys whatever you're up to for the rest of the day I hope it's good and I'll catch you all in that next video
Info
Channel: Spaceinvader One
Views: 121,919
Rating: undefined out of 5
Keywords: linux, unraid, unRAID, docker, vm, virtual machine, docker on unraid, docker in unraid, configure docker, setup docker in unraid, all about docker, all about docker in unraid, unraid tutorial, community applications, lime technology, lime tech, limetech, lime-technology.com, server, home server, nas, container, docker container, docker engine, linux containers, unraid containers
Id: ISJczs06pD8
Channel Id: undefined
Length: 21min 10sec (1270 seconds)
Published: Tue Feb 14 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.