-: In this section, there's just one last very quick command
around Docker Compose that I want you to be aware of.
At this point, we've seen several times that we can start
up a running container with the Docker CLI directly
and then we can in a second window run Docker PS
and get the status of all the running
containers that we have.
Now, a very similar command exists
for Docker Compose as well.
So if I stop that running container and then bring
up my two different containers using Docker Compose
I can then print out the status
of both of those containers by using Docker compose PS.
So again, same thing as the Docker CLI
just for Docker Compose.
So I've got my two running containers here.
I'll open up a second window
and then I'll do Docker dash compose PS
and that's gonna print out the status
of the two containers inside of my Docker compose file.
Now when I say that right there
the two running containers inside of my Docker compose file
this is something I wanna make sure is really clear.
When I ran Docker compose PS right here, I ran it
from the same directory as my Docker compose.yaml file.
When you run Docker PS, it's going to specifically look
for a Docker composed file inside of your current directory
and if it finds one, it'll read that file
and then it will try to find all of the running containers
on your local machine that belong essentially
to this Docker composed file.
If you try running the Docker composed PS command
from any other directory
you're gonna get an ear message that says
Hey I know you wanna get the status of containers
but which containers?
Docker, composes knock
and you just kind of magically figure
out which containers you're talking about.
It needs that Docker composed yaml file
as kind of a reference to understand which
specific containers it's proposed to get the status of.
So as a very quick example,
I encourage you to go up one directory.
So now inside this folder
I do not have a Docker composed file
and so inside of here, if I run Docker composed PS.
I'm gonna get an air message that says, Hey sorry
I have no idea what containers you're talking about.
So just remember with a lot
of these Docker composed commands, you need to run it
the commands from the appropriate directory.
All right, so that is pretty much it
on Docker compose right now.
So let's take another quick break
and we'll continue in the next section.