Welcome back.
In this step let's look at a couple of commands to see what containers are running.
What are the media which are present in the locating machine and all that fun stuff.
So let's do a clear and I would run a command.
Darker images.
So when I Dockery images you can see three images which are present in here.
Hallowell Jala Hallowell No.
Yes.
And Hallowell by then you can see this specific tag of that specific image.
The idea of it and also you can see when it was created and what is the size of that specific image.
So when we ran our command what happened was these images were downloaded from Docker Hub to your local machine and all these images are now present on our local machine.
Now how can you see the containers which are running.
I can see docker container.
Ellis LSA short form for list.
So docker container list you can see what are the running containers at this particular point in time if you launched up any other containers then you'd also see them in here.
You can see that this is a container right.
This is the image which was used to launch up the container.
You can see what at the command which is used to launch up.
This is a python application to Python launched by the way was used to launch it up.
You can see when it was created about five minutes back.
And what is the current status.
It says it's up so it's up and running right now and you can see which is the port which is published.
So the port five thousand from inside the container is exposed on to the local host to the port five thousand one.
The interesting thing is a container name is also assigned.
So when we were running the command we did not really assign any name for the container.
So Docker assigned a default name to every container.
So you can see that there was a name called modest Williams that was assigned to this one and there is a name called elated Robinson that is assigned to the javascript or the no JS container.
The interesting thing is docker container Alice only shows the containers which are running at this particular point in time.
If I would want to show all the containers I mean there were containers which we stopped earlier as well so we can do a darker container a less hyphen a.
So what does this do.
This would show all the containers which are in even exceeded status.
Now you can see all the containers which we launched up earlier as well you can see that in did mean Halloworld Java was launched up and it's in a status of exited and it exited about nine minutes ago.
So we launch it up 13 minutes ago and it exited exited status nine minutes ago.
So docker container LSI if any displays all the containers including this top and declining containers
that do a docker container Ellis and I see that there are a couple of containers which are running right now.
And I would want to stop one of them.
How can I do that.
The command is docker container stop.
So docker container stop.
Which one do we want to stop.
You can see that all here I'm only seeing substring of the items earlier when we launched up the container there was a big string with more than I think 40 to 50 characters which was present.
But now here you can see the truncated version of that specific string so you can use this string or any of the unique first few things.
So I'm saying C to be a.
So I'm just using these four characters and things docker container stop C to be what would happen to
talk a container unless you can see that the C to be a container is no longer listed in the active containers.
So this is how you can stop the containers from running or you can actually stop the applications which are running.
So we have stopped the python container which is we have stopped the python container which was actually running on port five thousand.
So let's see if python 1 is working it should throw an error call it says site cannot be reached.
That's perfect.
And you can also stop the other container.
So docker container stop let us do zero for a 5 and it should kill the other running container as well so it is taking a little while.
It took about five to 10 seconds and at the end of it the container was stopped.
And if you'd go to fight doesn't end on it.
You would see that the container is also stopped.
Now if I do a docker container a less none of the containers are running at this particular point in time in this quick step.
We looked at a few important comments related to containers and images will play around with a lot more command related to containers and images.
A little later in the goods I'll see you in the next step.
Add Comment