THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.
This tutorial explains multiple ways to show a list of containers in the Docker
docker ps command is used for the list of containers with different options. It is an alias for the
docker container ls command
The following are different commands
docker container ls docker ps
docker ps command has the following options
--all: Displays all containers(default lists running containers)
--filter: filter based on conditions. Example display exited containers with status=‘exited’
--last int: last n number containers
--size: show total file sizes
To show a list of containers in a docker, please follow the below steps.
Containers can be in a state of running or stopped.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1fdb4b122a13 localstack "top" 3 weeks ago Up 3 days localstack
-a(all states) option
docker ps -a
docker ps -l
docker ps -f "status=excited" or docker ps --filter "status=excited"
docker ps -q
docker ps -a -n3
docker ps -s
ps is a name used for process status in Unix OS, Docker ps is used to find the container status and it has different options for listing containers with running status, sizes, last created containers
Recent postsJulia examples - Variable Type Nim example - Convert String to/from the Int How to get length of an array and sequence in Nim? Nim environment variables - read, set, delete, exists, and iterate examples? How to convert from single character to/from string in Nim?