ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 208 - XK0-005 discussion

Report
Export

An administrator would like to list all current containers, regardless of their running state. Which of the following commands would allow the administrator to accomplish this task?

A.
docker ps -a
Answers
A.
docker ps -a
B.
docker list
Answers
B.
docker list
C.
docker image ls
Answers
C.
docker image ls
D.
docker inspect image
Answers
D.
docker inspect image
Suggested answer: A

Explanation:

The best command to use to list all current containers, regardless of their running state, is

A) docker ps -a. This command will show all containers, both running and stopped, with details such as container ID, image name, status, and ports. The other commands are either invalid or not relevant for this task. For example:

B) docker list is not a valid command. There is no subcommand named list in docker.

C) docker image ls will list all the images available on the local system, not the containers.

D) docker inspect image will show detailed information about a specific image, not all the containers.

asked 02/10/2024
Joost Huggers
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first