Exam4Training

Which of the following commands will help to accomplish this task?

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
B . docker push images -a
C . docker rmi -a images
D . docker images rmi –all

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.

Latest XK0-005 Dumps Valid Version with 136 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version