#6 - How Docker Runs Windows OS Containers 🪟

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this lecture we be talking about Docker for Windows we have been talking about Docker in Linux world even though we run Docker desktop in Windows operating system we know that behind the scene Docker desktop uses what is called as wsl2 or Windows subsystem for Linux 2 behind the scene right that was the engine that we have used all these days with the docker desktop but now we're going to talk about Docker for Windows now you may ask like Karthik what is Docker for Windows is all about well Docker for Windows is an special Docker built by Microsoft and the core operating system which is running inside those container is Microsoft's operating system so basically it runs Windows operating system behind the scene instead of a Linux operating system so all these days we know that while we run a Docker container it actually runs on a Linux operating system but this time this is going to run the container on an Windows operating system so you can find all the different Registries or the artifact registry of this Windows container not from the hub. do.com that we used before rather we are going to be using this mc. microsoft.com us so that's where all the repositories are sitting to download the containers from so you can see that Windows actually offers four container based images that users can build from and each base image is different type of windows or Windows Server operating system that has different on disk footprint and also has a different set of Windows API set so you can see that basically the windows container runs the core operating system either using Windows Server core or Nano server or Windows itself like a full windows API set or Windows Server itself which is going to be a full windows API set as well so you can use any one of them and the Nano server is the most smallest of all of them which actually runs the uh small footprint of all of them but you're going to be developing the Windows application or the aspn based application on and windows container if you want to run them then you should be using the Windows Server core because it supports the Net Framework applications in build on them so that's what is this Windows operating systems containers so let's quickly see how this whole setup can be done in the docker desktop and how you can do that in this particular Docker desktop that you have already got within your Windows machine just for a word of caution if you're going to be using this Docker desktop on a Linux machine or in a Mac operating system you can't run the windows container on those operating systems because you know that even though Mac as well as the Linux operating system uses the container which runs on Linux operating system it actually has an core Linux operating system or unique operating system in itself so you can't use an Windows container on those operating systems because you need to have a host machine as a Windows operating system so basically the docker desktop for Windows can only run on Microsoft's Windows operating system and it can't be used in any other operating system well as that said I'm just going to go and search for the docker for Windows in the Google or Bing and you should see that it is going to bring up this particular operation so you can see that it it says Docker desktop on Windows please just don't go with this particular word I'm just going to say Docker for windows with Windows containers and if you just go and search this time you should see these particular operations are going to come I have already covered in my YouTube channel for Docker for Windows if you just go and search in the YouTube for exit automation Docker for Windows you should see that understanding Docker for Windows is a new playlist which has got all the details that you need to have to work with the docker for Windows itself as you can see over here so this is something I have covered like seven years before but it's going to give you all the details related to the Windows container which is going to run on an Windows operating system that's what this particular uh playlist is going to be basically well as that said I'm just going to show you how to run the first Windows container uh on your Docker desktop so they have given some details over here and you can see that this time while you do a Docker pull command on the CLI you should be using an mc. microsoft.com Windows Nanos server colon any any of the version so if you just specify this way it means it is going to talk to this registry instead of the docker desktop's default registry as you know and then it is going to pull the image for you within your machine but even before you do that let's let's say I'm just going to copy this particular command and I'm going to go to my windows terminal over here and if I just put this and if I hit enter you'll notice that this particular Docker desktop is going to give me an error message and it says that pulling the Windows server and what's next and it says that view a summary of the image vulnerabilities and recommendation and also gives me a message saying that no matching manifest for Linux or amd64 in the Manifest list entries which means there is no way that it can find this particular Docker image which can download within your Docker desktop over here so how do I actually download this particular Docker desktop to run an Microsoft containers or the windows container within this particular Docker desktop so in order to do that you you actually need to go to your Docker desktop over here just right click it and you see that there is something called a Switch to Windows container so this is an option which is specifically available just on the Windows operating system of Docker desktop you won't find it in Linux or Mac operating system so just that's very very important for you to understand because you can't run Windows container on those two operating system you can only run in Windows 10 11 or 8 operating system like that so I'm going to go and Switch to Windows container and what what's going to happen behind the scene while I do that is it's going to give you a prompt saying that you're about to switch the windows container existing containers will continue to run but you will not able to manage them until you switch back to Linux containers so no data will be lost otherwise do you want to continue so existing containers which is running in my Docker desktop will still continue to run but just that we can't manage those containers unless until we switch them back to Linux container so I'm going to go ahead and switch it right now and once I switch that you will notice that it is going to tell me that there is a privilege helper service is not running so it needs to be run as well in a system privilege mode do you want to start the service and I'm going to hit this start the service and now it's going to be asking me with the UAC or the user account control to tell me that this particular service needs some privilege to get through so I'm going to say yes and it will now restart the docker desktop behind the scene as you can see over here is doing something behind the scene and now it has already switched to Windows container and you see that now we giving me that switch to Linux container which means I can hop back to Linux container from there and the UI and everything remains exactly the same there is no change on that but just that you won't see the image specific to the Linux container you remember we had the engine X container up and running so that proves the point that the existing images can't be managed using the docker Des that we already have so now if I just go to our command line interface and if I just do a Docker images you won't see any image that you have already downloaded but now if I just do a Docker pull of the mc. microsoft.com something like that you will notice that it is going to start pulling the Nano server from this particular registry that you can see over here which is cool right like this is for the first time we are seeing a Windows container running on our Docker desktop so far we have been using the Linux container and most of the time to be honest I tell you you'll be ending up using only Linux container not any Windows container but this is just like an additional info that you need to know that there is something called as Windows container as well in the world of the containerization stuff so now that this particular image is downloaded and now if I just do a Docker images you should see there is going to be an image coming up over here and then you can also see the image in the Docker desktop and if I go and hit this particular image you should see that there is going to be some details I mean there's not a lot of details that you can actually see behind the scene but this is the uh this is the container basically and now if I try to run this particular container it's going to ask me if I need to expose the names or stuffs behind the scene or if I want to set any executions path pretty much exactly like how we did before but if I wanted to run this I'm actually going to use this command over here the docker run hyphen it to specify if I want to run this in interactive mode we have not covered this so far but I'm just going to give you a heads up that this is how you actually do it and I wanted to run an command line code from this particular container so what I'm essentially telling that hey Docker just run this particular image as an container that we have got and run the command. exe for me so this is what this particular command is telling me so if I going to copy this particular uh command and if I paste this over here so talker run hyphone it for interactive mode which means you get the feedback loop from the container which is running and I wanted to run the application command. exe as the first thing while the container starts so while I start running it you will notice that it is now running the container for me behind the scene and you see there is a command prompt just came in from the container so this is not the windows which I'm running this is running the windows version 10 which is not the windows 11 operating system and it is an Nano server is running and if I just do an LS or sorry di because you can't use LS this is a Windows operating system you should see that is going to be a Windows over here and if I just do a notepad I don't see any notepad and if I wanted to go and see if the container is running if I just go to The Container you see that there is a container running which is all coming up over here and you can inspect it as well and most importantly you'll also notice that we don't see a files tab over here so you can't really browse through the container behind the scene and you'll also don't see the stats because it's a Windows container so you won't see a lot of information which you used to see from the Linux container in this particular Windows container so that's a limitation as well that you have I've got because it's a proprietary software and proprietary operating system so you need to have all those information just not available on the doer desktop yet so yeah this is basically rning the Windows operating system for me using the windows container so I can probably CH something like an echo of the hello Windows container uh something like that and just going to print them I mean those are the simple stuff that you can do and I don't think there is a net as well so net list yeah it's not a aable over here so basically this is a nano server so it doesn't have the net but if you go download the windows core server it's going to have the dot net for you so I'm going to go and close this particular command line and you should see that uh this particular terminal is completely closed but it is running the container behind the scene for me over here so this is what is all about the windows container and how you can use Windows container within your Docker desktop for Windows once again as I told you this is just an additional information that you need to know that how you can run a Windows container using Docker desktop but most of the time you will be ending up using the Linux container so as that said I'm going to quickly switch back to Linux container but even before I do that I'm going to just delete this particular container forever uh and the image so I don't really need them uh let me go and stop the container and I will switch back to the Linux world because that's where most of the time we are going to be using our containerization and stuff so looks like the container is the image has been deleted and now if I going to switch back to Linux container starting our next lecture we'll once again talk about how we can work with Linux containers in even more details
Info
Channel: Execute Automation
Views: 256
Rating: undefined out of 5
Keywords: Udemy, course, executeautomation, testing, Windows, Docker hub, docker container, docker images, What is docker images, Downloading images, containers, what is containers, understanding containers, docker CLI, manage docker images, manage docker container, understand docker cli in seconds, docker works, Docker architecture, Windows container, Docker for windows, Windows OS Containers, Microsoft
Id: qBiQDprcTFs
Channel Id: undefined
Length: 12min 47sec (767 seconds)
Published: Mon Jul 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.