[No Audio]
Let's start our demo where we have ended the previous one.
The list of containers is still the same,
just the time duration has updated.
In previous demo, we had created the container called
cc_busybox-A, but we did not run it.
Now, to send it into running state, let's use docker container
start command followed by the name of the container.
We don't have to provide flags like itd,
since they have already been passed during
the create command, let's run it.
[No Audio]
We won't even get a container id here, since, that too had been
generated previously, all we will get is the name
of the container as a nod to success of the
command in typical Docker CLI style.
Time to get repetitive, and list out the containers again,
using 'docker ps -a', and we have an update
our created container 'cc_busybox -A' is now finally
in running state. Just like start, we also have a
command to stop the containers, since a has just
started running, let's stop cc_busybox_B.
Again, a confirmation signal is the name of the container.
And if you want to verify it, let's list our containers again and wait.
Where's our cc_busybox_B?
Does that mean there is an error? Well, no.
If you remember, we had applied a flag called rm
in our last demo with docker run command on
cc_busybox_B container, which meant that the
container will be deleted once it has stopped running.
The use is simple. If you want to
reuse the container, keep it, if you don't want to
reuse it, remove it and free up some resources.
Next, we have the restart command. Let's restart
our cc_busybox-A container.
We will also give it a buffer of 5 seconds
and when we verify it,
what we get is a fresh restarted container up and running.
Finally, I think all of us would agree
that cc_bbusybox-A was not that great of a naming convention to follow.
Its just lengthy, over complicated and bland.
If you encounter such thoughts with your containers,
we have a command to rename them.
Let's be a bit more casual and
rename cc_bbusybox-A as my-busybox.
And when we list them, we can see the changes reflected.
By the way, notice that the
container has just been renamed, not restarted,
which means, we can rename them almost whenever we
want unless they affect some other containers.
In next lecture, we will do something more
application related with our containers.