DEV Community

Discussion on: Learn Docker - from the beginning, part I images and containers

Collapse
andy1 profile image
Andy

Yet another note: the tutorial doesn't include instructions on how to stop running your container. There has to be a better way than this, but I had to open a new Terminal tab, find the ID of my container by running

docker container ls

. I copied and pasted the id and then ran

docker container stop [ID]

Collapse
softchris profile image
Chris Noring Author

actually, you can run docker ps to get a list of running containers. Then you can find out both name and id, either is good when you try to stop it next which you do with docker stop [id or name]. Usually, you only need the first 2-3 characters of the id

Collapse
andy1 profile image
Andy

Realized this is addressed later in the tutorial, yay :)

Collapse
vp31 profile image
vp-31

to view containers running:
docker ps
to view all created containers:
docker ps -a