In the previous lecture, we have successfully created a new container based on Hello world image and
we have seen such output in the terminal.
Now let me explain you what actually happened under the hood and why this container has printed this
text to the terminal.
Let me show you one more diagram with image example.
I have told you that every image is simply a set of different layers.
In one of those layers there are instructions.
Text instructions which tell Docker what it needs to do when new container is created based on specific
image.
For example, let's have a look at this image.
In this image, there are several layers.
Base image is Ubuntu.
In the next layer there is an application that was installed in separate layer and for example there
is WordPress application.
And finally, there is an additional layer with some text, with some command that tells what container
needs to do when it is created.
And example of the command in this particular image is start WordPress process.
Of course, this command is in human words, but under the hood it will be different.
But again, idea is that there is a specific command that tells what to do, which process to start
when new container is created.
And in this example when we have started Hello world container, there is an instruction to run specific
executable file that prints text to the terminal.
That's it.
And I could actually quickly show you where is this file inside of the container.
For that I could enter Docker inspect command.
Actually, I need to enter Docker dash first in order to find out ID of the container.
No worries.
We will talk about it a bit later.
And next type docker inspect and copy this id from here.
Like this.
And let me scroll up a bit.
And here you could find cmd instruction.
And in this container Hello file was executed.
It is basically Linux executable file and this goal just simply print such text to the terminal.
That's it.
All right.
But what is container and what you are able to do inside of the container?
Let me answer this question in the next lecture.
See you there.