[Intro Music]
All right in the previous lecture I
have explained you differences
between management commands and
commands; and you know that there
are pairs of commands that are
called alternative commands; and you
are able to use either alternative
short command or long command with
management command. For example,
'docker ps' and 'docker container ls'
is pair of alternative commands.
Alright, let's now proceed and I'll
tell you now about most popular
commands that are used for
containers management in Docker.
First command, 'docker run' is
short version of command 'docker
container run'. This command starts a
new container, and you are able to
create multiple containers
simultaneously on the same Docker
computer. Next command 'docker stop',
this command stops running
container. And when this command is
executed, Docker basically sends
under the hood SIGTERM signal
to specific process inside of the
container; and if that process
reacts to SIGTERM command, then
container will be stopped pretty
fast. But sometimes processes don't
react to SIGTERM signal; and in
such case, after entering the
'docker stop' command, you'll need
to wait 10 seconds, and afterwards
Docker will fall back to 'docker
kill' command; and this command
actually sends a SIGKILL signal to
specific process; and
corresponding container terminates
very fast. All right next command
is 'docker rm'. With this command you
are able to remove a specific
container that was already stopped.
You're not able to remove a running
container, you need to stop it first,
and only afterwards remove with
'docker rm' command. Next command,
'docker ps', lists running containers,
and this command is already
familiar to you, and I have used it
in a previous lecture. Alternative
long version is 'docker container
ls'. And last command is 'docker ps
-a'. With '-a' option
supplied to 'ps' command you're able
to list all containers including
stopped containers. Please notice
that instead of '-a' option, you're
able to use also long version of
this option, '--all'. That's all
for most popular container
management commands. And next let
me briefly overview most popular
images commands. 'docker pull'
command is used for pulling image
from Docker Hub. And if
corresponding image already exists
in your local cache, then no pull
will be performed, and you will be
able to simply reuse currently
located in your local cache image.
Next command 'docker images' lists
downloaded images that were already
downloaded, pulled from Docker hub
to your local cache. 'docker rmi',
removes image or images from your
local cache. If you don't need some
images, you could simply use this
command in order to free up some
space on your local setup. And
finally, example of additional
commands that you could use along
with images is 'docker build.'.
With this command you're able to
create new custom image based on
created Dockerfile. And we will
talk about that in one of the next
sections when I'll explain you how
to create custom images, and how to
push them to your account at Docker
Hub. Great, that's all for most
popular commands that are used for
management of images, for pulling
images, listing images, and removing
images. And next let's start some
practice activities, and let's pull
first image from Docker Hub, and
create container based on that
image. I'll see you in the next
lecture. Bye-Bye.
[no audio]