A container host used for rapid prototyping is running low on disk space. The administrator must reclaim space by deleting every stopped container, all dangling images, any networks that are not in use, and all anonymous volumes that are no longer referenced by a container. The cleanup must be done with a single command that still asks for confirmation before anything is removed. Which command satisfies these requirements?
docker system prune removes stopped containers, unused networks and dangling images. It does not touch volumes unless the --volumes flag is added. When that flag is present, Docker also deletes anonymous volumes that are not referenced by any container while still presenting a single confirmation prompt. Using --all would leave volumes intact, chaining separate prune commands would omit networks, and manually deleting images would ignore containers, networks and volumes. Therefore the command that includes --volumes is the only one that fulfils every requirement stated in the scenario.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are dangling images in Docker?
Open an interactive chat with Bash
What is the purpose of the `--volumes` flag in the `docker system prune` command?
Open an interactive chat with Bash
What happens if you use the `--all` flag with `docker system prune` instead?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access