Which command is used to remove all unused images in Docker?

Study for the Dockers Menu Test. Prepare with flashcards and multiple-choice questions that include hints and explanations for each query. Excel in your exam!

The command that is used to remove all unused images in Docker is "docker image prune -a." This command is specifically designed to help manage disk space by cleaning up dangling and unused images. When executed with the "-a" flag, it instructs Docker to not only remove dangling images (those that are not tagged and are not referenced by any container) but also any images that are not associated with any container, even if they are tagged.

This capacity to clean up both dangling and unused images makes it an effective tool for maintaining a Docker environment, ensuring that unnecessary images do not consume storage space unnecessarily. It is a part of Docker's built-in image management utilities, streamlining the cleanup process for users looking to optimize their Docker setup.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy