Run Docker in Windows - Setup, Docker Compose, Extensions

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
there's no better way to get more out of your computer hardware than through containerization and what better containerization method than Docker now a lot of you run Windows and unfortunately Docker isn't really natively supported in Windows but don't worry there's a way around that using Docker desktop so here we are in Windows 10 and let me mention that you do not need a Docker desktop you can get by with just the engine and CLI but there are some cool features within Docker desktop that I want to show off and there are versions for Mac windows and even Linux obviously we are on windows so let's check out the documentation and throughout this process you'll notice that the documentation is really good so you can go through at your own pace but we're going to go ahead and walk through step by step so unless you're using hyper-v we are going to need the wsl2 backend which is Windows subsystem for Linux which essentially will run a version of Linux directly within Windows now there are a lot of different distros you can pick but the default one will be Ubuntu and that's what we're going to go with because at the end of the day it doesn't really matter so before we install that let's check out the requirements here so one of them being 64-bit processor which is pretty much anything in the last 15 20 years four Gigabytes of system RAM and this is the important one bios level hardware virtualization support So this needs to be turned on within the bios so depending on if you have an Intel or an AMD processor you want to make sure you go into the BIOS and enable virtualization and depending on which version of Windows you're running you may need to run this Linux kernel update package to make sure that the wsl2 installation works so let's check it out we're going to click on the documentation and look at that it's fairly simple one line to get it installed so you're going to go ahead and open a Powershell and run the WSL install command now I've already installed it so it's just giving me a list of all the help stuff but what I can do is run WSL list online it'll give me a list of all the different distros I can install using WSL now I just did the default which is Ubuntu and if I simply run WSL bada bing bada boom we have a Linux machine and we can treat it as a regular Linux machine I mean it'll work just like if you installed Linux on your desktop or in a virtual machine so yeah cool nobody asked we care about Docker so let's get back to that so now that we have wsl2 installed now we can install Docker desktop for Windows so we'll just click this Docker desktop for Windows it will install or it will download rather and now we can install it all right so obviously we're using wsl2 instead of hyper-v and sure let's add a shortcut all right installation succeeded that's good close and now we can open up Docker desktop for the first time I accept take all of my info what's your role um where's where's the tech YouTuber option all right so here we are Docker desktop it's beautiful right I know and like I mentioned we have access to the CLI so we can just type Docker in Powershell and boom now I'm not going to go over everything with Docker that's way outside the scope of this video but let's walk through Docker desktop so they do give you a little command to run to get started because obviously there are no containers there are no images there are no volumes there's nothing so we're gonna go ahead and copy that paste it into Powershell run it and obviously the image is not there it's going to pull it and then run our container so just like that it was updated it gives us a little bit of information about each container that's running the name what image it's from status and the ports so we can actually click on that it will bring us to the hosted web page that it is running and there it is that is the getting started container that we just are on see it's hosted within localhost which is this actual machine so cool we are hosting something on Docker within windows neat and from here it's running you can basically break free from the nest and fly off into the sunset if you'd like but I'm gonna walk through some of the things that I like about it and how I actually use it on my main machine now I'm a big fan of Docker compose and the docker desktop installation actually installs Docker compose for us so let's walk through an installation using Docker compose I'm gonna do a file browser installation so if you don't know what file browser is it's an app that essentially is like a slimmed down version of nexcloud so so if we go in my documents you'll see that I have a Docker folder that I created if we go in there you'll see that there's a file browser folder that I created you'll see that there's a config a data and then a compose dot yaml file now I created all of these but the important thing is this compose dot yaml this is going to be an instruction set that tells us basically what to do when docker runs it so let's open it up and check it out so taking a look at it it doesn't look too much different than if you were to see a normal just regular Docker command it has the image the user ID ports volumes basically everything that you need out of a regular command but the good thing about compose is that it actually lets us combine multiple containers networks and whatever into a single stack now this is just a very simple one but again I just like the layout of compose I like having compose files makes it a lot easier you may think differently and that's okay so here you'll notice a couple of things I'm using Port 6443 to pass through to the internal 8080 port and then for the volumes it wants volumes for a data and a config directory and you can see that I've passed these exact file directory locations to these directories and to run this it's actually pretty easy so within Powershell you're going to CD to that directory which was in my documents Docker file browser NFI list what's in here you can see there's my compose file and all we have to do is run docker compose up D and that's going to look for a compose dot yaml file pull it and do everything it needs to do and you can see right away it created our stack you see it looks slightly different from just a regular container and if we go down in there you can see there's just a single container running in there so let's check it out if we click on the port it'll open up boom just like that we have file browser and log in using admin admin maybe we create a new folder test then we create a new file in that folder leave me alone call this one test file and say hello save neat so if we go into that location that we pass through data you can see oh look at that a test and within test there's our test file hello so here we have file browser container running within Docker desktop using Docker compose and pass through a host binding mount on our Windows machine so you may have noticed uh within that Docker folder I had one for pie hole as well and just like that I have another compose file in there but let's take a look at how we basically use a compose file and how we get a template of sorts so if I wanted to install pie hole I would say pie hole Docker compose going to Docker Hub we can see the pie hole page and scrolling down just like that they give us a template to use for Docker compose and you'll notice this for a lot of things you want to run in Docker so you notice there's a bunch of ports it needs to pass through you can specify a time zone and then again the volumes these are default paths to use within Linux so we essentially don't even need to touch much of this so if I open up mine we'll see it's honestly probably pretty similar yeah almost copy and pasted I'm using a different port for the web UI but again it's it's pretty much the same thing so just like the other one we can go in to that location we're going to go pie hole and we are going to run the same command Docker compose up D it's going to do the exact same thing there it is being created it is done being created and just like file browser a single container within our stack so we hosted it on Port 8082 so if we go to that it's going to be like oh forbidden blah blah just go to the slash admin page and log in with the default Pi hole password and look at that you have pie hole ready to set up for DNS for your entire network now if you've watched my videos you know that I'm a portaner boy and Cortana is just a Docker orchestrator that gives you a more usable GUI and adds a couple of more features to your already existing Docker instance so we're going to go ahead and install portaner now we're going to be using the Community Edition because we're not a businessman set up new using Docker Standalone and it's going to ask you if you're running on Linux or WSL honestly I think both of these instructions are pretty much identical it's too lines honestly so pretty easy either way the first one is going to be to create a Docker volume called Port Tanner data now we could just take this copy it and paste it within Powershell but let's go into Docker desktop go to volumes and we can just create it here the power of a GUI so say poor tainer is it hyphen data just like that it's created and if you're thinking cool a volume but where the hell is it so to access your Docker data you can do that within file explorer just open it up and we are going to navigate to backslash backslash wsl.localhost and in here you will see some different locations the one we want is Docker desktop and data and within there go to data Docker volumes and look at that there's our portaner volume and if you want some other information in there it can be all found within this directory and I'm just noticing it is underscore data not hyphen so um yeah let's fix that delete delete forever create retainer underscore data neat and now run the one single line Docker command to install portaner just copy it from there paste run and let's watch it I always like watching it on the container screen in real time because I'm weird so we're going to access it through https 9443 why try to open HTTP all right https call until backslash yep all right and then we can just create a password and now we are important to get started and you can see it hooked directly into our local Docker instance we can click on that and now we have an even fancier GUI to work with we can go in here and see our Stacks remember we created a file browser one and a pie hole and we can go and see our containers we can actually exit into them and connect directly up this one doesn't use bash uses regular shell and just like that we are hooked into our I don't even remember what container I clicked but we're inside of it and here you can walk through see images networks volumes all that fancy stuff and a cool thing is app templates they give you a bunch that you can pick from and just install them with one click or you can create your own custom templates and I have my own video All About portaner so I'm not going to go much more into it if you want to check that out feel free to do so I'll leave a link in the description yeah let's head back into Docker desktop and you can see again a portaner instance is running in our container Tab and just like that we have a cool little Docker instance running within windows but I do want to touch on one more thing and that is the extensions so you can go ahead and add extensions which gives you some more little features for your Docker and instance there are a couple that I want to take a look at one of them is resource usage which is pretty useful and go ahead and install that the other one is volumes backup and share and once those are done we'll take a look at them let's take a look at resource usage now it does exactly what you think click on it and you can monitor the resource usage of your entire Docker instance you can see we're not using much of anything out of 800 percent meaning eight cores we're using 0.19 percent this is why containerization is awesome extremely efficient on your Hardware memory usage how many containers are running you can scroll down here and get a breakdown of each of them really cool and taking a look at volumes backup and share this is another really cool plug-in it's going to list all of our volumes obviously we only have one right now it's really cool because you can export this volume and save it which is extremely useful for backing it up or moving it to an another Docker instance so if you're using this maybe as a test and you want to use it to deploy in production or another test environment you can simply export the entire volume and use it over there you can also import view clone empty it really useful and one funny thing I kind of noticed when I was putting this video together is that check out what we have as an extension or Tanner so you don't even have to go and do it the way that I did you can simply just click it once and install portaner but one thing I did notice is that it doesn't really run portaner as its own container within Docker I honestly don't know where it's running because if we go back into our containers you'll see that we still only have one instance of Port tainer running and if we go to the extension container it just opens up the same GUI but within the docker desktop window so honestly I would rather go with the normal way because then it can be accessed via you know any web browser from any machine on your network but hey if this is how you want to run it then go ahead but that is all I really wanted to cover for using Docker desktop on Windows I personally use it on my machine I do development I do a lot of testing in Docker so I'm a big fan of Docker desktop it's it's okay to use a GUI sometimes it doesn't make thank you any less of a nerd I promise all right that was Docker desktop on Windows I hope you guys learned something I hope it was useful for you get out there start messing around with Docker and maybe one day you'll be a mediocre home lab YouTuber like me but that is it I hope you enjoyed it drop a like if you did subscribe if you want to see more and I will see you in the next one [Music]
Info
Channel: Raid Owl
Views: 23,832
Rating: undefined out of 5
Keywords: docker, windows, home lab
Id: cMyoSkQZ41E
Channel Id: undefined
Length: 16min 2sec (962 seconds)
Published: Sun Mar 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.