Now the good news is that there's only
a few things left which I wanna explore it with you.
And the first thing takes us back to the images.
This image contains your code
and the application environment.
That's what you'll learn throughout this course.
That's why it's quite big.
The running container is then actually not really that big,
it's just an extra thin layer,
the command layer basically, added on top of the image.
So, this image code is used in the running container.
it's not copied again, just to make this clear.
The container builds up on the image,
and multiple containers running based on the same image
will share the code inside of the image.
That's why this code inside of the image is also locked in
and read only containers can only make changes,
And for example, create files inside of
that new extra thin container layer that was added on top
of all the image layers.
So, that's how that works.
But if you wanna know more about an image,
you also got a command for that,
you got the Docker image inspect command,
to which you can pass an image ID.
And if you do so, you'll see a long output there
with information about this image.
And let's go through this output
from top to bottom, to get a feeling
for some important things you can learn from there.
You for example, find the full ID of the image,
you find the created date,
to see when exactly this image was created.
You see configuration for containers that will be executed
that will be started based on the image,
for example, which ports will be exposed,
some environment variables
which are set in this case automatically,
and also the entry point, which by default is your command,
If you don't specify a custom entry point.
You see which Docker version is being used.
And a bunch of other things
which are not too important here.
But further down you, for example, see the operating system
which is being used, in this case
because we're building up on the node image,
which in turn builds up on
some Linux operating system image.
And if we scroll down further,
we also see the different layers of this image.
And keep in mind the different commands,
make up the layers of this image.
Now here we got 123456 instructions in front of command.
But of course, we got more than six layers here.
The reason for that is that it's not just
about the layers defined in our Docker file.
But we also automatically have two layers,
provided by this node base image which we're using.
So, our image uses all those layers in the end.
Which of course makes sense
because if the node image would change internally,
that also should lead our image to not use caching,
But to rebuild itself,
if we would run the build command again.
That's why we also have two layers
from the base image we're using.
And that's the inspect command,
which you don't need all the time.
But which can be interesting from time to time,
to see how your image is configured.
And how the containers you'll start based on this image,
will be configured.
Just in case you forgot or maybe
because you pulled in some other image,
from some other source, and you wanna look into it
and see some general configuration.
For example here, we could do that for denote image.
We can of course also run Docker image inspect
on that image.
And now we see the configuration of that image,
just in case you should be interested in that.
So, that's how you can inspect images and look
into them after they have been created.