WSL 2 With Docker Getting Started and Docker Desktop Installation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi i'm adam kopp and you're at beachcast in this video we're going to talk about wsl 2 with docker getting started so stick around and we'll get right on that [Music] so the previous video that i did related to wsl2 was the installation of wsl2 if you didn't see that video or if you had questions about it i'll make sure to link it up above so check that out before you go into this video you'll want to make sure that you have wsl2 installed along those lines let's check a couple things before we get too far into this so first let me open my browser i've got a couple web pages already up and ready for for this discussion one of them is the docker docs site where they have a lot of information around the installation and getting it up and working and all those things so if if i don't cover something specifically to your use case make sure you check out the docs on docker so as one of the prerequisites we want to scroll down on this page so now i'm in the install docker desktop for windows and i'm going to scroll down to where we see system requirements there are two different tabs here one is wsl2 backend and then there's hyper-v back-end and windows containers so we're going to look at wsl-2 back-end and here you see it's uh they're talking about windows 10 for home edition or pro for the for the wsl back end you can use either you can use home edition or pro and then of course we want to make sure we enable the windows or the wsl2 features in windows and then also there's some hardware requirements here 64-bit processor uh four gigabytes of ram make sure the the virtualization is activated in your bios for your motherboard and also you want to download and install the linux kernel update package now most of that is covered in my previous video so again check out that video up above if if you want to make sure that you have wsl installed first now as a second item here like i said there were two different tabs one is wsl2 backend the other one is hyper-v and hyper-v is only available if you have the pro edition of windows installed so windows home you have to use the ws wsl tube back-end you can't use hyper-v with windows home edition and that's fine because for me i'm i'm using wsl too now now to get started we want to go to the docker site so if we go to docker this is the docs but if we go to docker's main site and click on getting started or get started it brings us to the get started with docker page and you can see the docker desktop download that's a lot of these you can see the docker desktop download right here and if i mouse over this you can see there's windows there's mac uh either the intel chip or the apple chip and there's also uh you know view the linux engine now we're gonna be doing windows so let me go ahead and click download for windows and it's going to download that we want to put that in my downloads folder so i'm going to go there and and download the executable and that'll take just a few minutes it's 527 megabytes in size so once that gets downloaded then we can install so let me go ahead and get the downloads folder open and ready okay so in the downloads folder we see we have the docker desktop installer right here so i'm going to go ahead and double click that and by double clicking it it starts the installation first it prompts for the security warning about docker desktop i'm going to say yes go ahead and continue with the installation and now it'll bring up the install dialog let me bring that over here to the center there we go so it's downloading some additional packages now it's asking us do we want to install our required windows components for wsl2 and also asking if we want to add short shortcut to the desktop so i'm going to go ahead and keep both of those checked in my case i already have wsl2 installed so by by checking this box it's going to install it in wsl 2. now if i had already had i do have the professional version of windows running and i can double check that by bringing up inver and by bringing a win ver we can see what edition of windows i have i have running here and i do have windows 10 pro operating system but if you have home that's okay you can still have wsl2 installed okay so i'm going to click ok and it's going to go through unpacking and performing the installation for us okay so that took a few minutes for it to finish the unpacking of the of the application and finish the installation but now it is finished so i can click close and i'm going to go ahead and close down my downloads folder and get the browser out of the way now we notice on the desktop i do now have the docker desktop icon so i want to go ahead and execute that so i'm going to double click that to launch docker desktop okay so when you when you first launch there is the obligatory service agreement and changes you may need to pay attention to that there has been some changes recently on on who can use it and the licenses behind that i've already checked it out so i'm going to go ahead and agree and accept and now it continues to launch docker okay and now it is opened up to the dashboard of docker and we can see at the moment we have docker engine is starting and now that it is finished starting it comes to the get started with docker in a few easy steps so estimated times about two minutes let's go ahead and click start i could go ahead and skip the tutorial but we'll go ahead and click start and we see that it gives you some first steps of how to use docker cloning your first repositories and so forth i like the tutorials they make it very handy very easy to use and of course powershell is open up right here in the interface ready for us to use this i'm going to go ahead and skip past that now and skip the tutorial but if you've not used docker before go ahead and kick off the tutorial it's enlightening it's easy to use i'm going to go ahead and skip that we can see now we have no containers running if we look at images there are no images we don't have any volumes and a new thing that they've started recently is creating development environments so we're gonna i'll probably create a video later about that but for right now what i'm most interested in is is initially using docker so i'm gonna go ahead and use this command that they that they provide here so i'm going to click copy so that is copied to my clipboard instead of doing it from the command prompt on windows which i could freely do and it would it would be executing the docker uh container building and image downloading and everything in um in wsl2 but instead i'm going to go ahead and do it straight from within within ubuntu so let me open up launch ubuntu 2024 or 2004 so now we have that and i can issue the commands from right within here with docker there we go so docker run hyphen d hyphen p and that's for port 8080 it's mapping port 80 to port 80 docker slash getting started we'll execute that and now it well it's not able to find the image so it's going to download the image and get the getting started container all ready for us now that has finished now if i go over to the docker desktop we can see that i do now have a container and i can look at images and i do have the getting started image there as well that was used to prepare the container so the container's there everything works successfully now if i wanted to go the next step let's say i wanted to do something like docker run hello world and kick that off so it'll it'll now download the hello world image and create a container from that and we can see here that it does say hello world hello from docker and it's also given some additional things and additional items here this message shows that your installation appears to be working correctly and then it tells you what it did in order to generate that message so it's a good learning good learning tool now in addition they're also telling you a possible next step that you might want to do such as using docker docker run it ubuntu bash i could issue docker run it ubuntu bash and it's not able to find the image ubuntu so it's going to pull that down and right now it's going to pull that image down and create a container and then dump me to a prompt now you'll notice that the prompt is different here than it was up here this is the root prompt uh provided by the container so if i click if i click exit that takes me out of the bash prompt inside the container now i am inside my wsl instance of ubuntu and we can see that i've got files there that i would expect to find there now if i click exit from there then it brings me back to windows and because it's it's it's closed out of that ubuntu prompt now of course ubuntu is still running inside wsl too it hasn't actually shut down but it has shut down the terminal and we can see here throughout this process now i've got multiple containers and running one for ubuntu i've got one for the hello world and one for the getting started and then the images i've got multiple images here as well that we use to create those containers and docker desktop the the latest versions that are that are ready to work with either hyper-v or wsl-2 it knows that because it's able to keep track of everything inside the containers and again it's using wsl-2 for that now if i were to open up open up my powershell and let's take a look at uh if i were to do wsl2 or wsl rather and do hyphen l for list and then verbose i can bring up my containers and we can see here i have ubuntu 2004 it is running and then i've got docker desktop data and docker desktop running notice here that there's an asterisk beside ubuntu 2004 by default that's what docker desktop is going to use when it executes if we look in the settings of docker and by going to the docker desktop dashboard i can click this icon for settings uh get rid of the tips i can click this for settings and i can see it starts docker desktop when i log in it's telling me to use the wsl base engine it's telling me wsdl2 provides better performance than using hyper-v back-end now if i look at the resources and go to wsl integration there's where we can see that it enables integration with the default wsl distro and again ubuntu had the asterisk beside it you can see it in the background here and so that is where what it's going to use by default if i had multiple virtual machines installed here they would be listed here and then i could toggle these toggle switches to select which one to use versus the default if i desired so at this point i have wsl2 set up and working i've now installed docker desktop to use wsl2 as the back-end system docker works very well using wsl-2 versus hyper-v however for the pro version of windows you could use hyper-v if you wanted to if you found this video helpful remember to like the video it really helps as far as publicity goes lets other people know that the video is here and spreads the word about beachcast i really hope you enjoyed it and and got something out of it and until next time take care and i'll see you then
Info
Channel: Beachcasts Programming Videos
Views: 26,157
Rating: undefined out of 5
Keywords: wsl 2 with docker getting started, windows subsystem for linux docker, docker install on windows 10, wsl docker, install docker windows wsl2, wsl with docker, wsl docker windows 10, docker wsl2, adam culp, adamculp, beachcasts, wsl 2, windows subsystem for linux, windows 10 wsl 2, docker desktop, getting started wsl 2, windows subsystem for linux 2, docker tutorial, windows 10 wsl2, docker tutorial for beginners, development environment, docker desktop windows wsl 2
Id: h0Lwtcje-Jo
Channel Id: undefined
Length: 13min 27sec (807 seconds)
Published: Tue Oct 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.