docker ps
See your containers: which are running, which stopped, their ports and names.
>_ Try it: a simulated Linux, right herenothing runs on your computer
Loading the terminal…
Examples
-
docker ps -
docker ps -a -
docker ps -q -
docker ps -a | grep Exited -
docker start site
How it works
docker ps lists the containers that are running, with their ID, image, status, ports and name.
Stopped containers are hidden unless you add -a. A container that "vanished" is usually just stopped: docker ps -a shows it with its exit code.
Syntax
docker ps [OPTIONS]
Options
| Option | What it does |
|---|---|
-a | all containers, stopped ones too |
-q | only the IDs (handy in scripts) |
Good to know
- STATUS
Exited (0)means it finished fine; another number means it failed: checkdocker logs NAME. - The PORTS column reads host->container:
0.0.0.0:8080->80/tcp.