In the previous lecture, Echo explained what happened when we agreed that new.
Hello World container from hello World Image and basically executable file called Hello was executed.
And the responsibility of this file is simply to bring thanks to the terminal.
That's it.
And afterwards, container was stopped.
Now, let me explain you what container actually is on this diagram you see in which layers here.
And you already know that every image is read all live, all FSR layers in the image are read.
Only you aren't able to modify them when you create a new container from a specific image.
Dogor creates very small rya double layer.
And you are able to read from that layer and right that layer create new files and folders and every
container has its own rioter bill layer.
In this example, there are two different containers, container, a container, a be created from the
same image.
Let me quickly do that.
Actually, let me go to terminal and greet one more.
Hello, Walter.
Container.
Dr. Ron.
Hello, world and ISIS, same result.
And if I and Dogra B as this eckermann now, I'll see that there are no two different stopped containers
and those two different containers used.
Same.
Hello, Rolt image here and here.
But the comment that was executed inside of avideo, those containers was the same.
It was launch of the hello file.
All right, let's proceed after creation of the container, Dogra actually loungers specific process
specific brought us inside of the container.
And as long as at least one process is ironic, inside of the container container is considered as a
running.
But as soon as protest ends, container is stopped.
Let me explain you, all of this using an ARS or diagram on this diagram, dolus dogor host.
It is Linux computer.
There is dogor agent installed inside, also area Linux machine.
It has a Linux kernel and cite your sources as C.P.U, RAM Network and Hard Drive.
And let's suppose that we have already pulled some image from Dogor Hub here was this image located
on the hard drive of this dogor host.
And this image, let's assume, has two different afast layers.
Image of one and image afast two.
And again, those image Leros allocated on how dry up of this dogor host, when you enter Doka Iran,
some image comment dogor will create additional rideable layer for new container.
That is a first action.
And this rideable layer will be created here on a hard drive of this.
Dr. Holst.
Next, you know that every image has instructions which are executed when new container is created.
And in case with HelloWallet, in which this command was Iran, Kalloor executable file.
And that means that you brought this on this Dr. Holst is created for particular new container like
this.
New protest is greeted, this process does some job.
And afterwards, if this brought us arms.
Dogor removes this container from memory.
And in such case, when there are no protesters running inside of the container container, we'll be
stopped by Dr..
But those files rideable, the first layer for this container remains on the hard drive.
But if you remove particular stopped container, then dogor, of course, removes this rideable first
layer as well.
It means that are able to greet multiple containers like so great container one with additional rideable
the first layer.
But notice that we don't need to create those layers.
Because those layers are already present on hard drive.
And this container will actually reuse those afast layers.
Any processes running inside of this container will reuse those first layers.
All right, rideable first layer was created, Broaddus was launched.
And now let's suppose that this process is a long grinding brought us like database process or, for
example, we execute some sweeps up or from some long ground actions and so on.
And in such case, when Braudis is running, container is kept running.
And Derris brought us in memory of this dogor Holst.
And of course, Linux kernel manages all requests to resources like C.P.U Ramp Network from this process.
All requests come via Linux kernel.
Afterwards, when this container is running, let's suppose that you want to create new container using
the same image.
In such case, again, Dr. Creed's new rideable, the first layer, four new container.
Those layers remain here.
This container, too, will simply reuse those two first layers and next it creates new brought us for
new container.
And to gain this brought us communiques with resources like C.P.U, Rame Network and Hard Drive via
common Linux Kernel Container 11 and they they to communicate by a common Linux kernel.
But processes are completely independent.
They are different, but ironic on the same Dr. Holst.
All right.
That's what happens when you create new containers based on a specific image and key point here is that
our first layers of basic image that was used for creation of those containers are reused.
They are not copied to any new container.
Every new container gets just in you, right?
Well, a first layer.
That's it.
And when brought this is stopped in specific container, dogor stops.
Container as well.
And removes it from memory.
But the files of this container still remain on the hard drive until you enter doka our and command
and remove specific stopped container.
As you'll see from this diagram, Dogra utilize the resources of Dr. Holst very efficiently.
Throws it reuses files on the hard drive.
There is no need to copy file system leros from a specific image.
When you create new containers.
For every new container, dog agrees, just new arrival, a first layer all remaining underlying the
first layers are reused from this image.
And next, Dogor does not keep a container running.
If there are no processes running inside the container, it immediately stops container.
When there are no protesters running.
All right.
Let's not go to terminal and let's remove containers that we have created before.
Basically, picture in our case is like this.
There are no containers running.
But there are still two containers on hard drive.
But those containers are stopped.
Let's go to a terminal.
And here again, leased containers that we are stopped.
There are no containers running.
And now let's use dogor our command in order to remove stopped container and less forced to remove this
container.
Let's take its idea and let's remove it like so and let's remove second container.
But let me use alternative version of this command docker container.
Our M and you are also able to use randomly generated name in order to perform some actions with container.
Let me copy this name and based here as argument for our AM command and second container was removed
as well.
And now there are no containers that are currently running or stopped.
Great.
But I still have image docker image just on the list.
Hello, Walt, image and busy box image.
It means that no picture is following.
There are no our first layer of four containers.
But there is still image on hard drive with correspondant first layers.
Basically, there are two different images at the moment.
And you are able, of course, remove images as well using Docker, my command.
And here you could type or image I.D. or name of the image in order to remove it.
Let's remove Beezy box image.
Deleted and less or removed.
Hello, Walt.
Image, Kalloor, Rolt.
A world in which was removed as well.
And now if I'll have a look at least of images, I'll see amped at least.
And that means that at the moment there are no images on hard drive on local dogor host.
This whole picture looks like at the moment.
All right, guys, I hope you enjoyed this lecture.
And basically, that's all for this section where I made a small introduction into images and containers.
And next, let me briefly summarize what we have covered in this section.
I'll see you next.
Bye bye.