0
0
Dockerdevops~10 mins

Listing containers (docker ps, docker ps -a) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to list all running Docker containers.

Docker
docker [1]
Drag options to blanks, or click blank then click option'
Aps
Brun
Cstart
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker run' instead of 'docker ps'.
Using 'docker start' which starts a container but does not list them.
2fill in blank
medium

Complete the command to list all containers, including stopped ones.

Docker
docker [1] -a
Drag options to blanks, or click blank then click option'
Aps
Bexec
Cimages
Dlogs
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker images -a' which lists images, not containers.
Using 'docker logs -a' which is invalid.
3fill in blank
hard

Fix the error in the command to list all containers including stopped ones.

Docker
docker ps [1]
Drag options to blanks, or click blank then click option'
A-al
B--alll
C-all
D-a
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-all' instead of '-a'.
Typo in '--alll' with extra 'l'.
4fill in blank
hard

Fill both blanks to complete the command that lists all containers showing their IDs.

Docker
docker ps [1] --format "{{.[2]"
Drag options to blanks, or click blank then click option'
A-a
BNames
CID
D-l
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-l' which shows only the last container.
Using 'Names' instead of 'ID' when wanting IDs.
5fill in blank
hard

Fill all three blanks to create a command that lists all containers showing their names, status, and image.

Docker
docker ps [1] --format "{{.[2] - {{.[3] - {{.Image}}"
Drag options to blanks, or click blank then click option'
A-a
BNames
CStatus
DID
Attempts:
3 left
💡 Hint
Common Mistakes
Using ID instead of Status for the third blank.
Omitting the -a flag and missing stopped containers.