nerdexam
CompTIA

XK0-005 · Question #573

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?

The correct answer is A. docker images prune -a. 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…

Scripting, Containers, and Automation

Question

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?

Options

  • Adocker images prune -a
  • Bdocker push images -a
  • Cdocker rmi -a images
  • Ddocker images rmi --all

How the community answered

(24 responses)
  • A
    88% (21)
  • C
    4% (1)
  • D
    8% (2)

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.

Topics

#Docker#Container images#Image cleanup#Container management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice