ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 87 - XK0-005 discussion

Report
Export

A cloud engineer needs to remove all dangling images and delete all the images that do not have an associated container. Which of the following commands will help to accomplish this task?

A.
docker images prune -a
Answers
A.
docker images prune -a
B.
docker push images -a
Answers
B.
docker push images -a
C.
docker rmi -a images
Answers
C.
docker rmi -a images
D.
docker images rmi --all
Answers
D.
docker images rmi --all
Suggested answer: A

Explanation:

The command docker images prune -a will help to remove all dangling images and delete all the images that do not have an associated container. The docker command is a tool for managing Docker containers and images. The images subcommand operates on images. The prune option removes unused images. The -a option removes all images, not just dangling ones. A dangling image is an image that is not tagged and is not referenced by any container. This command will accomplish the task of cleaning up the unused images. The other options are incorrect because they either do not exist (docker push images -a or docker images rmi --all) or do not remove images (docker rmi -a images only removes images that match the name or ID of "images"). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 567.

asked 02/10/2024
Jimmy Raiford
45 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first