 Hello everyone, my name is John Hammond. This is a video showcasing how to get started with Docker inside of WSL2 or the Windows subsystem for Linux. So let's dive in. I'll hop over to my desktop here. And as usual, I will just simply fire up Google Chrome, my web browser, and I will Google the thing that I'm looking for because I want to just be able to find it and research and know how to do it from the source. So let's simply search for Docker WSL2 and of course the absolute first result that returns back to me is the documentation, the official documentation from Docker.com, how to get started with WSL2 and Docker. So this explains how WSL2 is now awesome and much, much better than WSL1 and that, okay, we're really running Linux containers and Linux applications natively without emulation. That means we can actually run Docker. So recently I just released a video on getting WSL2 set up. Now we can kind of take advantage of this and we can use that to run Docker or do more things that we would normally be doing on Linux. So that superduper helps me and I hope it does the same for you. It explains here before we do this, before we actually set up and install Docker on your Windows 10 desktop to use through WSL for use in a Linux like Realm, you need to have Windows 10 version 20.04 higher. So I discussed this in the previous video when you're running WinVir, you can see that information or you're building information. We should have already accomplished that in the previous video. We've got WSL2 set up and installed on Windows. I could simply open up my terminal emulator and I am in Linux currently, right? ID, who am I? There we go. That's all great. Now we've got the ability to open up Docker. We've got the Linux kernel package already installed. All we really need right now is this Docker stable setup. Let's go ahead and install this. Let's download it. This page that it brings us here is saying, hey, this is the Docker desktop for Windows and it's the fastest and easiest way to get started with Docker on Windows. There's a download link over here. Just the stable rendition is all that we need. I will go ahead and download this. Takes a little bit of time. I'll speed this up. Great, now that that's downloaded and installed, let's fire that up. Okay, now our Docker desktop prompts us with some options here. We can enable WSL2 Windows features. Sure, add a shortcut to the desktop. Sure, I'm totally fine with both of those things and a little unpack the files that are necessary. Okay, now he's going ahead and installing. And great, our installation succeeded so we can go ahead and close this. Now, I'm gonna open up just my start menu and I will simply type in Docker to open up that Docker desktop application. And down below, you can just simply see, hey, we've got a simple notification. Docker is starting and now it is running. So we can open up PowerShell and start hacking with Docker or Docker compose. There we go. Okay, now we've got this little dashboard that pops up. We can get started with Docker in just a few easy steps. Let's go ahead and work through this. First, clone a simple repository. Oh, this is cool. It looks like it's giving me a little terminal over on the side here. Can I zoom in on this? Just a smidge, okay, great. Let me see if I can move this. Perfect, I hope you guys can see that okay. This getting started project is a simple GitHub repository which contains everything you need to build an image and run it as a container. It's all Git if you don't have it already. Looks like I don't have Git, at least from the command line wise. Can I jump into WSL to do that? Let's WSL, okay, great. Now I do have Git. So let's paste that in and clone that getting started here. I just went into my Linux distribution there. Great. Now that that is set up and installed, we do have a getting started directory just down there. Let's move on to the next step. Now we can build an image. So we want to change directory into that location that we just cloned and worked with. I can see there was a Docker file present in there. So I know, okay, we are gonna be working with a Docker image or Docker instance that we can see. And let's build that. The syntax they're using is Docker build, tactee, Docker 101 tutorial. So the tactee will be the name or the tag that we're gonna give this image and then a period to note the current directory where I'm gonna work in. Docker file, that file is present in there. So we'll start to build the context here, the Docker damage and it will create this image pulling from Python. Taking a little bit of time to grab all that stuff but it should be done in just a moment. There we go. It's running. Installing everything that's necessary for the image, still building it up. Let's see what that next step is. Once it's built, we can go ahead and run the container and that will run on port 80, interesting. So tactee to make it a daemon, right? So it's gonna be working in the background. That tactee to specify we're gonna map ports between our host and our Docker container. We're specifying a name, a Docker tutorial and then Docker 101 tutorial as the actual image that we're gonna end up running. It's still going through and cooking over there so we'll give it just a few more seconds. Okay, my prompt is back here. Now I should be able to run that command or Docker run, tactee, tactee, 80 map to 80. It can specify a name Docker hyphen tutorial and let's run the Docker 101 tutorial image that we just built. It's running as a daemon so we're simply getting that hash here or that SHA-1 identifier or whatever SHA-some that is. Now you can save and share image on Docker hub to enable others to look and work with it. We don't particularly need to do that. So great, we've got that running. We could check out view and browser to go see the tutorial. Let's fire that up. Great, and we could see the tutorial for Docker. Okay, easy enough. We don't exactly need to dive into that. I wanna see what else this dashboard will give us but it doesn't look like there's really anything else that's necessary. So if I were to fire up my terminal, now I will ideally be able to run Docker, which I am, and that doesn't error. That gives me the actual help information for Docker. Okay, let's do Docker images and see what we've got. So we've got this Docker 101 tutorial which is what we just built. We do Docker PS to see what is currently running and we can see our Docker 101 tutorial is there with that specific name. It's up for however many seconds and those ports are mapped just as we need them to be. So let's stop that. But that was super easy, right? Now we have Docker all within WSL, within Linux, within Windows, and we can get closer and closer and get better about using some of these Linux-like development stuff that we would want to use and had previously been kind of inhibited when we were on Windows, but now thanks to WSL too, it's actually pretty smooth and pretty easy. I could just run those regular Docker commands as you saw without any issue whatsoever and that can be super duper useful when we're preparing for capture the flags or helping build a capture the flag or doing our penetration testing and ethical hacking and all that stuff and having that environment in Windows, getting best of both worlds, doing Linux stuff when still accessing Windows stuff when we need it, that's pretty handy. So okay, that's the end of the video everybody. I've been going at this for a little bit and I hope you were able to stick with it, but super simple, super easy. We're just simply running Docker in Linux in Windows, WSL too, it's a good stuff. But thank you, thank you, thank you for watching. If you guys like this video, please do press that like button, maybe leave a comment, maybe subscribe. I'd be super duper grateful. Thanks, I'll see you in the next video. I hope you enjoy, take care.