Docker & Containers (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are dangling images, and how do you clean up disk space using `docker system prune`?
junior LevelMost AskedCode ExampleDocker & Containers
In Simple Words:
- Dangling Images (
<none>:<none>): Untagged image layers left behind when you build a new image with an existing tag (e.g., rebuildingmyapp:latest). The old layers are orphaned. - Cleanup Commands:
bash
# Remove all stopped containers, unused networks, and dangling images docker system prune # Extreme cleanup: Removes ALL unused images (not just dangling) and unused named volumes docker system prune -a --volumes -f