WEBVTT

00:00.750 --> 00:02.370
-: In the last section, we had a long discussion

00:02.370 --> 00:05.880
about the relationship between a container and an image.

00:05.880 --> 00:08.400
We had said that a container is a running process

00:08.400 --> 00:11.640
along with a subset of physical resources on your computer

00:11.640 --> 00:15.180
that are allocated to that process specifically.

00:15.180 --> 00:17.160
We also spoke a little bit about the relationship

00:17.160 --> 00:19.830
between an image and a running container.

00:19.830 --> 00:20.700
Remember, an image

00:20.700 --> 00:23.130
is really kind of a snapshot of the file system,

00:23.130 --> 00:26.400
along with a very specific startup command as well.

00:26.400 --> 00:29.190
Now, one thing that I wanna mention very quickly here,

00:29.190 --> 00:30.960
in the last section, we spoke a little bit

00:30.960 --> 00:33.870
about the separation or the kind of the isolation

00:33.870 --> 00:37.020
of these resources through a technique called namespacing.

00:37.020 --> 00:38.760
And we also said that we could limit

00:38.760 --> 00:40.080
the amount of resources used

00:40.080 --> 00:42.690
by these control group things as well.

00:42.690 --> 00:45.570
Now, this feature of namespacing and control groups

00:45.570 --> 00:48.870
is not included by default with all operating systems,

00:48.870 --> 00:50.070
even though in the last section,

00:50.070 --> 00:51.870
I had kind of specifically said like,

00:51.870 --> 00:54.870
oh yeah, your operating system has a kernel, too.

00:54.870 --> 00:57.480
These features of namespacing and control groups

00:57.480 --> 01:01.140
are specific to the Linux operating system.

01:01.140 --> 01:04.350
So namespacing control groups belong to Linux,

01:04.350 --> 01:06.990
not to Windows, not to macOS.

01:06.990 --> 01:09.210
So that might make you kind of question or wonder

01:09.210 --> 01:11.430
how are you running Docker right now?

01:11.430 --> 01:12.900
You know, we are running a Docker client

01:12.900 --> 01:14.760
and we are running Docker containers

01:14.760 --> 01:17.820
on a macOS or a Windows operating system.

01:17.820 --> 01:20.670
How is that happening if these are Linux-specific features?

01:20.670 --> 01:23.070
Well, here's what's happening behind the scenes.

01:23.940 --> 01:27.240
When you installed Docker for Windows or Docker for Mac

01:27.240 --> 01:30.030
just a moment ago in the last couple sections,

01:30.030 --> 01:33.510
you installed a Linux virtual machine.

01:33.510 --> 01:36.000
So, so long as Docker up here is running,

01:36.000 --> 01:38.430
you technically have a Linux virtual machine

01:38.430 --> 01:40.590
running on your computer.

01:40.590 --> 01:42.450
Inside of this virtual machine is

01:42.450 --> 01:45.150
where all of these containers are going to be created.

01:45.150 --> 01:48.270
So inside the virtual machine, we have a Linux kernel,

01:48.270 --> 01:50.220
and that Linux kernel is going to be

01:50.220 --> 01:53.430
hosting, running processes inside of containers.

01:53.430 --> 01:54.870
And it's that Linux kernel

01:54.870 --> 01:57.240
that's going to be in charge of limiting access

01:57.240 --> 02:00.360
or kind of constraining access or isolating access

02:00.360 --> 02:03.300
to different hardware resources on your computer.

02:03.300 --> 02:04.530
You can actually kind of see

02:04.530 --> 02:06.870
this Linux virtual machine in practice

02:06.870 --> 02:08.430
by opening up your terminal right now.

02:08.430 --> 02:11.100
And if you run that Docker version command again

02:11.100 --> 02:12.450
and look at your server,

02:12.450 --> 02:15.570
you'll notice that there's actually an OS entry on here

02:15.570 --> 02:16.403
and you'll notice

02:16.403 --> 02:19.590
that it probably doesn't have your operating system listed.

02:19.590 --> 02:22.320
Mine, for example, right here says very specifically Linux

02:22.320 --> 02:24.150
as the operating system.

02:24.150 --> 02:26.010
So that is kind of specifying

02:26.010 --> 02:27.900
that I'm running a Linux virtual machine

02:27.900 --> 02:29.190
and that's what's being used

02:29.190 --> 02:30.930
to host all these different containers

02:30.930 --> 02:33.360
that you and I are going to be working with.

02:33.360 --> 02:35.460
So just a little bit of interesting trivia.

02:35.460 --> 02:37.020
Now let's take another quick break right here.

02:37.020 --> 02:38.250
We're gonna continue the next section

02:38.250 --> 02:41.880
and start digging into the Docker client a little bit more.

02:41.880 --> 02:44.303
So quick break and I'll see you in just a minute.
