Which command would you use to remove an unused Docker image?

Prepare for the Docker Certified Associate test with our comprehensive quizzes that include key questions and detailed explanations. Ace your certification!

To remove an unused Docker image, the command docker rmi [image_name] is the correct choice. The rmi command specifically stands for "remove image" and is designed to eliminate images from the local Docker repository. When you run this command followed by the image name, Docker will delete the specified image, provided that it is not being used by any containers.

This command is effective for managing unused or unnecessary images, helping to free up system resources and maintain a clean development environment. By using docker rmi, users can ensure they are also receiving feedback about any dependent containers or errors that prevent the image from being removed.

The other options do not appropriately designate the operation to remove an image. The terms "remove" and "delete" are not valid subcommands in the context of managing Docker images. Additionally, docker rm is used for removing containers rather than images, further highlighting the specificity of the rmi command for image management.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy