[Intro Music]
Now you know that every image is
read-only, and it has multiple FS
layers. Now's a good time to create
a new container based on already
pulled image. And let's create
first hello-world container. For
that, let's use 'docker run' command,
that will create a new container;
and afterwards, as argument we
supply the name of the image we
want to use, 'hello-world'.
Recap that this image is already
located in our local cache, we have
already pulled it from Docker Hub.
Great. Let's press Enter. And you
simply see some text in this
output. And afterwards, we go back
to terminal. And that means that
container is no longer running. It
has performed some job and that's
it. And now there are two
questions. First one, why this
container has printed this text to
the terminal? How it knows which
action to perform when we create
new container? And second question,
why this container has exited? Why
it is no longer running? Actually,
I could verify that it is not running
anymore using 'docker ps' command,
and list of active containers is
empty. Before answering those
questions, let me read together
with you this output, 'Hello from
Docker! This message shows that
your installation appears to be
working correctly. To generate this
message Docker took following
steps. First sep, Docker client
contacted the Docker daemon'. Recap
that 'docker' command is actually a
Docker Client. It is a binary file
located at your computer. And when
you enter 'docker', along with any
additional commands, Docker Client
contacts Docker Daemon, and sends
this command to it. That's what
happened under the hood. Next step,
'Docker daemon pulled hello-world
image from Docker Hub'. Basically,
we have already pulled this image,
that's why this step was skipped.
Docker has verified that there was
already a hello-world image located
in local cache, that's why there is
no need to pull it from Docker Hub.
Next step, 'Docker daemon created a
new container from that image which
runs executable that produces
output you are currently reading'.
That means that Docker has created
a new container based on hello-
world image, but what is actually
container? I'll answer this
question in the next lecture. But
let me finish reading this output.
Finally, 'Docker daemon streamed that
output to the Docker client, which
sent it to your terminal'. It means
that communication between Docker
Client and Docker Daemon is bi-
directional. Docker Client sends
some commands to Docker Daemon, and
Docker Daemon returns some result,
and this result was returned
actually by Docker Daemon, and
Docker Client has printed this text
to the terminal. And afterwards
last step that was omitted here,
this Docker container was stopped,
because it has already done
its job. Now, let me proceed, and
next let me clarify a bit deeper
what actually happened under the
hood, and what is container, and why
container decides to print such
text to the terminal. Let me talk
about it in the next lecture. Bye-Bye.
[no audio]