Docker Desktop for Windows 10/11 Setup and Tips

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this video is from my docker mastery course on udemy and i've pulled this section of videos on installing docker desktop and put them into a playlist here on youtube you can get all the details in this series of videos look for the playlist somewhere in this interface on mac windows linux both desktop and server for my preferred way to install docker desktop and learn docker and kubernetes locally on your machine you can get course discount coupon links below the discord community i have for all things devops my podcast live show everything else get those links below and i hope you enjoy is your machine windows 10 or 11 then this is the video for you for getting everything you need in this course you're going to need a supported version of windows desktop that's windows 10 or 11 at the time of this video and that's any edition of windows 10 or 11 home pro enterprise any of that and i'm also going to show you some settings you probably want to tweak inside your docker desktop setup and then we're going to make sure you have the course repo cloned locally and you also have some other tools set up that'll make it easier to do this course on windows and we're also going to make sure you have visual studio code now you technically don't have to use visual studio code in this course but i think it's the best editor right now for devops and it's what i'm going to be using and i encourage you to try it out docker desktop is still the easiest and best way to use docker and kubernetes combined on your local machine so i'm going to be recommending that now there are a lot of other ways to use docker i have a spreadsheet that i'll link to in the resources for this lecture that give you other options beyond docker desktop but docker desktop really it's got it's got everything you need and with windows 10 and 11 docker shifted to using wsl 2. if you're not familiar with the windows subsystem for linux it's the best way to run linux on windows it's built into the operating system it's a native feature of windows straight from microsoft and it works really smoothly with docker desktop so during the install it's going to set up that for you if you don't already have that so here's the basic steps for setting up docker desktop if you've not done any of this stuff before and the docker docs are amazing so you will spend a lot of time here in this course there's so much information in the docker docs and that tells you how to install docker of course down below you'll see a link to download the executable the installer and that'll get us started now one of the first options you'll see on the screen when you start installing docker desktop is asking you about wsl 2. the old way that docker desktop used to work years ago was with hyper-v and it was a full vm running linux and docker inside it wsl-2 is more efficient on your battery it's more efficient on your cpu and resources so generally we're going to want to do that option if you can then once your installation is succeeded it's only partly configured it's actually going to take a few more steps especially if you've never done wsl and as a reminder here docker desktop has a license and it's not always free but it's always free to learn and i've got confirmation from management at docker that this is exactly the reason they have a learning license so you can take courses like mine to make sure that any enterprise or business or personal use that you intend to use and some of those are requiring a paid license that you can still learn docker in this course and in other learning materials free on docker desktop in fact you'll see a screen similar to this that basically means you need to agree to their eula and it indicates in there that it remains free for learning and you'll just need to click the i accept button and move on now as a part of this install you're going to do several things to the windows host operating system one of those is wso2 will be installed and then it also will need a linux kernel update so there might be several reboots involved once you've installed wsl you'll get this message saying hey i need to reboot because wso requires a reboot of the host operating system but after that reboot you may get an additional setup here and you'll notice windows subsystem for linux update setup so this is an extra little step that will make sure that the linux kernel inside of your wsl gets updated to a newer version and then that actually becomes a part of your windows update and my understanding is windows wanted to keep this separate so that you didn't have to update the full windows host in order to get a new updated linux kernel now once you see a screen like this that's a little blue window that is known as the docker dashboard that means everything is finally working and you can use the internal tutorial but you know you bought my course so why not just do my course so you can skip the tutorial right there or of course it doesn't hurt to get your intro to docker in the start button up there i'm going to go ahead and skip this tutorial and give you some tips now here's a tip that can prevent a possible error in the future of this course when you're downloading lots of stuff with docker a docker download of an image so you can run containers is called a pull kind of like a git pull and that requires access to the docker hub website now you normally get 100 downloads every six hours at least that's the current limit without logging in but if you log in with a free docker id you can get twice as many pulls 200 polls in fact and you can log and pay for more and even get more polls but we don't need to pay for right now we don't need to pay for anything right we're just going to download stuff and learn so i recommend going to hub.docker.com links are in the references for this lecture creating your free docker account and then if you log into docker desktop with it you get way more pulls of images and in case you get an error when you try to start up docker or you try to use a docker command and it's not running and it doesn't run properly and you get various errors you might see something like this this error is telling you that you don't have the extensions enabled on your cpu in the bios for virtualization this course requires docker running locally in docker desktop to run virtualization that's how docker desktop works unless we're running on a linux server somewhere there's usually no virtualization needed there it runs natively on linux but on windows and mac and even a linux desktop we will be using a virtual machine on our local hardware to run linux and docker it's actually safer that way more secure for docker to run inside of an enclave and in order to do that we need the bios extensions for virtualization so this probably indicates that you've never run virtualization on this computer before something like virtualbox if you've heard of that parallels vmware there's all sorts of virtualization software now docker comes with its own but it needs those bios extensions enabled so you're going to need to check your specific bios on your specific hardware to make sure that anything related to vtx or intel virtualization extensions or there's a whole bunch of different names for it just look for something around vt vtx or virtualization enable that and then this should go away now here's some tweaks i recommend on your docker desktop setup to get the best out of its utilization and the speed that you would need to make it go fast and just make this course easier now in order to get to the settings of docker on windows you need to go down to your system tray down at the bottom right and find the mobi icon if it's not there then docker desktop probably isn't running and right click on this guy his name is moby yes he's the mascot and underneath that icon when you right click you'll see a settings option that will get you to all the settings inside docker and once you right click you'll see this screen and look for the settings option to get to the settings menu once you're in the settings you can poke around but one that you'll want to pay attention to is this particular screen this has to do with your shell and in wsl windows subsystem for linux we need to use a linux shell to get into that vm that ws runs for us and in docker it's going to show them here anytime you install another subsystem whether it's ubuntu or debian or any of the linux distributions you'll start to see them show up here and you'll want to enable them for docker desktop support and this gets us a little bit into wsl in case you're new to that but windows subsystem for linux is fantastic kind of said that already right but when you go into the windows store you can download different distributions and you need one preferably in order to interact with docker in linux now technically docker desktop can still allow you to interact with it from your windows host but i recommend getting into linux it's where all your containers are going to run on servers anyway so you might as well start getting used to it locally on your machine and this is a great way to do that go to the store search for ubuntu and download ubuntu's wsl option and it's a mini little linux vm and it doesn't take up a lot of space or use up a lot of memory by default so it's okay to run and once you click that get button it'll download and install then that button should change to open which when you click it will open a shell using bash right into that linux vm and on the first time you run it you'll get prompted to create an account because your windows account is not going to be the same as the linux account in this wsl vm so you can create the same username and password or something completely different but you'll need to remember this so you can get back into wsl later now once i've done that i will be at the ubuntu bash shell and the way i can test this is just to type docker version you'll get back the version of the client and the server hopefully that will not give you an error we'll talk more about that in the next section if you're into security stuff and maybe learning a little bit of white hat hacking total side note but another great variant or distribution of linux that you can install in wsl is kali kali linux it's not related to this course but once you've installed multiple wsl distributions which you totally can but you don't have to you can just install one for this course but once you've picked a couple you'll need to go back into the docker settings to make sure that each of those shelves is enabled for docker you'll see here that i've enabled both kali and ubuntu in my wsl and i need to come back in here to docker settings because this won't happen by default and i need to click those little toggles to enable docker for each one of those wsl subsystems and there we go they should be blue and now we can start running docker commands from inside wsl now years ago when docker desktop came out and it was only going to support hyper-v at the time because wsl 2 didn't exist there was this limitation where we really needed to run docker from windows that's from powershell or from cmd the command prompt but no more i don't recommend you do that because the commands are different the options you have at the command line are different different things are subtle that kind of get in the way of you doing what you need to do because the rest of us on mac and linux are all using bash and zsh and shells from unix but in here with windows we technically have powershell in the older command prompt but no more microsoft is recommending you'd use something new called the windows terminal which is automatically installed on windows 11 but on windows 10 you can get it for free from microsoft in the store and this is what it looks like if you go to the windows store to download windows terminal you'll get this one it's officially from microsoft so you know that's the right one and then you can run that and it will run the powershell shell as well as your wsl shells and also the old old command prompt that we've had since like windows three and you'll see these options when you start a new shell you'll see whatever ws you've installed it will keep them updated in this list and you can even customize windows terminal to make new ones of these custom versions of these with different fonts and colors and themes go nuts but it doesn't really matter what you do you're just going to be able to use this to get a bash shell which will give you compatibility at the command line for all the docker commands and kubernetes commands will run in this course so for me i'm going to do ubuntu i think ubuntu is one of the best operating systems on the planet for linux and linux there's lots of distributions tons of them but i think ubuntu is a great one when you're first learning your shells and your command and tutorials there's so much out there on the internet for help for free for ubuntu and it's one of the best supported linux distributions for docker so i'm definitely going to be using it throughout this course here's a little pro tip you can change the windows terminal to be your default terminal for anything you need to run in windows normally in the past it's been powershell or command prompt which are now legacy terminal windows there's still shells inside the terminal window but the gui as we call the terminal that's what you want to run windows terminal so go up there to that default profile and change it from windows powershell to bash and wsl and then you can also change the default terminal application to windows terminal that way you always are launching the latest terminal gui and the bash shell inside of wsl as your default cool i just changed my top two options there that's my preference you don't have to do that but it will make launching and starting things in this course easier now remember that docker version command i told you to run you can go ahead and run this now we're going to run it the next section just to make sure everything's running correctly but you'll get back client and server versions if everything is up to snuff now if you don't know what visual studio code is i love it it is my favorite devops editor and it's technically a full-fledged code editor has tons of stuff and support for every language that i can think of but it's also a great devops language editor for the yaml that you're going to learn about the docker files that you're going to learn about all the different files that we do it's not technically code it's more of a data language structure a lot of these things or a scripting structure so don't worry you don't have to know how to code to do docker or kubernetes but it has docker and kubernetes features in it if you add the extensions and it has great support for running in wsl and if you're interested in more of the advanced features in visual studio code the extensions you might want to use and all that there's a video later in this section that will give you more details because this editor works everywhere linux desktops macs windows it's what i use every day for years now now let's talk about getting the course repo the repository for this course is available in a link in this lecture it's available in the previous lecture that actually had all the links for all this stuff in a written form and it is something that you're going to want to clone down into your linux subsystem it turns out with docker because docker is running in linux it's actually faster for you to do stuff with these code examples i'm going to give you and all the different docker files and compose and kubernetes and we're going to get to all that but it turns out that stuff is better in linux so it's better if you get clone into the linux subsystem file system which is different than your host the way to know is if you're in a slash users slash username rather than in a c colon backslash users if that's a sql in backslash on your path that means you're in the host file system and i'd rather you get into your windows terminal inside of that wsl like ubuntu and once you're in there clone into that location this repository it'll work better from there now over on github for this repository you can click on the green code button to copy or clone this repository down with a simple command git clone and then the url git is going to be in your ubuntu or typical linux wsl distribution so you'll have the git command already all right if you're a windows user which you were watching this video hopefully because you're a windows user then you've got docker desktop you've got the repository you've got an editor maybe visual studio code you've downloaded that repository into your wsl and you're ready to start using the examples inside the repository and running docker commands later in the course we'll get to kubernetes commands and how docker desktop enables kubernetes in the options but we'll worry about that once we get to kubernetes for now you can choose to watch the rest of the videos in this section or skip them for now and that's my recommendation skip the operating systems that you are not using even linux server if you don't plan on using a linux server until way later in this course you don't need to know how to set up docker in it yet you're just going to focus on using it locally on your machine that's totally fine and keep the rest of these videos in this section to come back to as a reference but move on to the next section if you think you're ready
Info
Channel: Bret Fisher Docker and DevOps
Views: 28,379
Rating: undefined out of 5
Keywords: docker tutorial, docker tutorial for beginners, docker desktop, learn docker, install docker desktop, docker desktop license, docker desktop faq, docker desktop for learning, install docker for learning, learn kubernetes, install kubernetes for learning, docker course, docker on windows, docker containers, docker compose, docker for beginners, docker basics, install docker on windows, docker windows 11, install docker desktop on windows 10
Id: rATNU0Fr8zs
Channel Id: undefined
Length: 17min 54sec (1074 seconds)
Published: Mon Sep 12 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.