The running theme that we have seen with Dharker compose is that it makes it a lot easier to work with
multiple containers at the same time.
In this section we're going to take a look at two different commands that we had previously used with
darker Seelye and get a sense of how to run them with darker compose instead.
So the two commands we're going to look at.
Well just the first one for right now.
We'll move on to the second one just a moment.
I want you to recall that in the past we executed a or created a container by running docker run Dashti
and then the name of an image like say rattus.
This started up a new container but it executed in the background so we could continue running commands
in this terminal window if we wanted to.
We could then get a print out of all of our running containers with Dr. p.s..
So there's the container I just created and I could then stop that container by copying the ID and executing
docker stop and pasting the ID making kind of imagine that when we start using docker compose and we're
working with multiple images or multiple containers at the same time it would really be a pain to have
to run Dockers stop with each different ID for each container we started.
So Dr. kapos we can automatically start up multiple containers in the background at the same time and
then close them all at the same time with one single command.
So here's how we do it to start up a group of containers in the background using that Dashti flag before
like we do with Dr. Seelye we can run or compose up and then Dashti on the very end.
We can then stop all of our running containers with Doc or compose down an easy way to remember down
right here is that hey doc it blows up the opposite of going up is going down.
So let's try this out.
Still inside of my visits directory all around doc or compose up Dashti that's going to start up both
to my containers in the background so I can continue running other commands here.
I can do a docker P.S. that'll show our two running containers and then to start both them at the same
time we can do a docker compose down like so and when I run that it's going to stop and then remove
the two containers we had created.
So if I do another Dr. P.S. No nothing here anymore.
All right.
So that's pretty much it.
Again there's a lot of commands from the Dr. Seelye worlds that have kind of a one to one translation
over to Dr. compose.
So let's take a quick pause right here and we'll continue looking at a couple other commands in the
next section.