[Intro Music]
In each new programming language
learner will always start with
simple program called hello-world.
And the studying of Docker is not
an exception. That's why I suggest
to start from the very first simple
container, the most simple one,
called hello-world. For now, you
should have Docker installed on
your computer, and we are basically
ready to go. Let's go to terminal,
I'll use macOS in this section,
and the let me simply type 'docker
run hello-world', like this, press
Enter, and see what will happen. I
see message, 'Unable to find image
'hello-world:latest' locally'.
After that image is pulled from
Docker Hub. And afterwards, I see
this section of text in terminal -
Hello from Docker! This message
shows that installation appears to
be working correctly, and so on.
Afterwards, I got back to terminal
and actually you see that container
was exited. You could also verify
that there are no currently running
containers using command 'docker ps'.
And you see here empty output only
with headers of the columns like
CONTAINER ID, IMAGE, COMMAND, and so
on. Let's try to run the same
container once again. 'docker run
hello-world', Enter, and now
you'll see the same result as
before. The goal of this container
is simply to start and print this
piece of text to terminal. Nothing
else. As soon as this is done,
container exits. That's all about
the most simple hello-world
container that you could use in
Docker. And also from this example,
you see that Docker has actually
pulled the image called hello-world
:latest' from Docker Hub. You
see this action here. This image
also has sha256 Hash. And here you
see this hash as well. Great.
That's how you're able to create
the very first container pretty
fast and easily. But basically this
container is useless. All what it
does, it simply prints to the
console a piece of text, and that's
it. Also, let's have a look at the
this sequence of actions that
actually happened under the hood
when we have entered this command
'docker run hello-world'. First step,
Docker client contacted the Docker
daemon. It means that there are two
different pieces of software -
Docker client on one side, and
Docker daemon or Docker server on
the other side. Next, Docker daemon
pulled the "hello-world" image from
the Docker Hub. That's what I have
already told you. We have tried to
find the image called 'hello-world
:latest' locally, but there
were no images, there was just
clean installation and that's it.
That's why Docker server or Docker
daemon has decided to pull image
'hello-world' from a Remote Registry
called Docker Hub. Here you see
this information. On the next step,
step number 3, Docker daemon
created a new container from that
image which runs executable that
produces output you are currently
reading. It means that after pulling
the image from Remote Registry, from
Docker Hub, local Docker has
created a new container based on
that image. On the last step,
Docker daemon streamed that output
to the Docker client. And that's why
you actually see this text here in
your terminal. And afterwards, the
Docker container was basically
terminated. Actually, I would add
here additional step, step number
5, container was exited. That's
actually all what happened under
the hood when you have entered
this command 'docker run hello-
world'. When you run the same
command, second time, third time
and so on, Docker skips this step,
because this image 'hello-world' is
already present in your local
cache, and you could verify that
using command 'docker images', and
you'll see first image here on
the list, 'hello-world', and there was
a tag called 'latest'. We will get
back to tags a bit later in this
course. Also, you may see here
IMAGE ID. It is simply a set of
characters, hexadecimal characters,
basically. And you'll see how long
ago this image was created. It was
created more than one year ago, and
its size is simply two kilobytes.
It is the most smallest image
possible. Okay, that's all for this
example, and let's move on to next one.
[no audio]