Listing images
The following command can be used to show a full list of Docker containers, irrespective of state. If you want to see only the running containers omit the -a
(stands for all) option:
docker ps -a
The -f
or --filter
flags are applicable for the preceding command. -f
or --filter
, when used along with docker ps [OPTIONS]
, the list of containers, will be filtered as per the filtering condition provided along with this flag. For example, the following command shows details of the container matching the name:
docker ps --filter name=nostalgic_norman.
A few more valid flags for the filter option are exited=0
, status=paused
, and ancestor=windowsservercore
. The following options are also valid while listing images:
-n
: Shows the number of containers in any state-l
: Shows the latest container created-s
: Shows total file size
The usage is very similar to the filter flag shown previously.