Menu
Coddy logo textTech

Listing All Containers

Part of the Introduction to Docker section of Coddy's Terminal journey — lesson 14 of 40.

Plain docker ps only shows containers that are currently running. Containers that have already exited disappear from that list, but they are not gone.

Add the -a (all) flag to see every container, running or stopped:

docker ps -a

The STATUS column tells you which is which: a running container shows Up ..., while a finished one shows Exited (0) .... This is how you find a short-lived container after it has already stopped.

challenge icon

Challenge

Easy

Run an alpine container named quicktask that echoes hi (it exits immediately), then list all containers so the exited one still appears.

Cheat sheet

Use docker ps -a to list all containers, including stopped ones:

docker ps -a

The STATUS column shows Up ... for running containers and Exited (0) ... for finished ones.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Introduction to Docker