[Autogenerated] Docker is the primary system that knows how to use
windows containers and on top of that you can have other management
entities such as kubernetes and so on.
But we use docker here and of course dr in itself is a very big
product and definitely out of scope for this module.
But you can find many decorated courses on pluralsight so what I've done
here in my Windows 11 you have installed Docker desktop.
This is a fairly painless installation that you can find online and it's free.
There's a higher level version of Docker for several components,
but it's good enough to use Docker desktop for testing and trying things out.
So the first thing you want to do once Docker desktop is installed
is go to the Docker icon here in the in the train and switch to
Windows containers because by default,
Docker uses Linux containers and Linux containers work on
Windows using a future machine hybrid technology.
And if you enable WsL two, they work with WsL two,
which is definitely better than the original Hyper-V VM.
That it was using however,
were interested in Windows containers which are even more lightweight than
the View virtual or the hybrid virtual machine technology.
For Linux containers.
Were interested in Windows containers.
So we make the switch, it takes a couple of seconds.
You can verify that.
Currently you're using Windows containers because you can see it asks you,
it allows you to switch back to Linux containers if you so desire.
So the first thing I'm going to do.
I'm going to launch uh command Window with the mean privileges
and show you the list of volumes in the system.
I'm going to use a tool called F L T M C,
which is a built in tool in Windows that allows us to look at
information rated to file system any filters.
However, it also has the option to show the list of volumes in the system.
Some of them are mapped to drive, some of them are not.
So you can see here that there are a bunch of volumes here.
One of them is mapped to my C drive here.
However,
there are other things here like named pipes and mail slots and
we're not really concerned about that too much.
But I want to compare that after we actually launch a container.
I want to compare that to the new list of volumes and see that
there's a new volume created to redirect the file system
activity that the container provides.
So now let launch a container,
let me launch another command window which now launches the terminal.
Doesn't really matter.
And I'm going to use Docker,
you can verify the doctor runs properly just by using
Docker version here to make sure that the doctor is
properly installed on your machine.
If you haven't done so already, let me now run a container.
So I'm going to use Docker run command with a dash I.
T.
Option which means interactive.
Interactive means that I want to be able to communicate with the
with the container within by by issuing commands using the
command Window and get back a response.
And then the thing to do here in case of Docker desktop on the
client machine is to specify that you like the isolation to be
process which means Windows containers.
Otherwise it will use the Hyper-V future machines
as the as an isolation boundary.
So you have to specify that on client machines because it is not the default.
And then I'm going to use the simplest possible image,
container image which is named Hello World and what Docker does here.
It looks for that locally.
If it finds it, it uses it.
If not it contacts the Docker hub and loads Hello World
container image and then runs that on my system and within
that container just like to run cmd.
So we'll be able to do something and the container will not immediately die out.
So once I do that it tries to locate this locally it can't find it locally.
So it's going to download it for the first time from the Docker hub.
And because this is the simplest and the smallest image that you can have,
it doesn't take more than a few seconds typically to download that and be ready.
And once it happens you will see that we get a command win
which is completely fresh where you can communicate with
the container and here it is.
We're now within the container to prove that a little bit we can use a
directory listing here and notice we have just users directory,
Windows, directory Hello txt file, which we can,
which we can examine here by using type Hello dot txt or something.
And we'll see that there's a welcome message from Docker.
If I run another command window and look at my real
machine here and use a deer here, you can see it's definitely different.
You can see different directories here.
So obviously this is not my machine here.
It is a container but it still looks like the sea Kahlan uh, drive here.
Let's look at what we see here in fl TMC volumes once again.
And you can see there's a new volume here that has been created.
And this is the one used by docker by default to be the re directorate
file system for whatever is happening in the container.
How can we be sure of that?
Well, we can we can try to map that into a drive.
Okay,
so let's open another command window and try to map
that vase into a different drive.
So I have a simple tool called D D D, which is short for define those device,
which is the actual function using behind the scenes to create that shortcut.
I'm going to call the dr Z just for fun and paste in that
particular volume name and it says success.
Let's see let's browse to Z now and you can see that the Z drive now from the
host perspective shows exactly the contents we see here,
within within the container.
And so that gives us a very simple way to copy files into the container.
So let me go to my C tools directory here and I want to
copy a file here called Prak List.
So product list is a simple tool that I've written that just
enumerates all the processes in the system.
So if I go ahead and run that from my host machine,
you use product list here to run it.
We can see a big list of processes.
Well perhaps not that big or perhaps even Super Big 237
processes on my Windows system here.
You can see the details of these processes and their path.
So that's a simple thing to do.
In fact,
it uses an API the tool help API using the function create to help 32 snapshot
you can find the documentation for processing liberation now that I've copied
the file Also this application to the container.
We can see that from the container perspective it is here Prock list.
Let me run it.
And you notice something weird.
We only see a very limited list of processes.
Only 18 processes being content here within the container.
So you can see that enumeration apis understand that
if you're coming from a container,
you shouldn't be seeing the entire set of processes in the system.
You should only be able to see things that are part of your container.
And this is perhaps an indirect way to figure out whether
you're actually running in a container or not because there is
no other direct way to check that.
And you really shouldn't be concerned with that.
If you're just some process running within the container,
because this is really the point of a container running in an abstraction that
doesn't really let you know or you shouldn't really care.
But whether you're running in a container or not,
you can see here processes like system process and really neat and so on.
You can also see that there are a bunch of services here,
but definitely a smaller list that you find on a typical Windows system.
And if we open task manager will find that there's a new session that has
been created that hosts this exact set of processes.
Let me so show sessions here.
If you don't see the session column,
just use select columns here to add the session I D column.
And if you sort by session,
you'll see that now there is another session this case session number
two that hosts the processes for this container.
We can try this again.
Let's go ahead and open another command window and create yet another
container by running exactly the same command we've run previously and in
this case the Hello world Images already in on this.
So there's no need to find it again, let's do that.
So it's not going to be looking that on the web, simply opening a new container.
You can see that immediately.
We have now another session coming up which hosts
this particular set of processes.
And again, if you look at the disk here, there's apparently nothing there.
If I open up administrative command window once again,
just to show the F L T M C tool again.
So here's F L T M C.
I'm going to use volumes here.
And you can probably guess there's a new volume here, shown right here.
That's another one that has been created to be the
target of this particular view.
Virtual machine.
And we can go ahead and do the same kind of experiment
again by a mapping this to a drive.
You don't see the drive here because it's only mapped in the
current user and not on on administrative uh,
command here.
And so that ministry doesn't really see that directly.
But on the user side this is available.
But you can use the same kind of uh,
command again to see the new drive here and again manage that in a separate way.
So you can see that the host has this view.
That is kind of showing everything that we have in the system in this case.
Two containers.
How can we see more details about these containers in other tools.
That would be the topic of our next video