Challenge - 5 Problems
Docker Cleanup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of the command
docker system prune -f?You run
docker system prune -f on a system with unused containers, networks, images, and build cache. What will this command do?Docker
docker system prune -fAttempts:
2 left
💡 Hint
The
-f flag forces the prune without confirmation.✗ Incorrect
The docker system prune -f command cleans up all unused data including stopped containers, unused networks, dangling images, and build cache without asking for confirmation.
✅ Best Practice
intermediate2:00remaining
Which option is the safest way to clean up unused Docker resources without affecting running containers?
You want to free disk space by removing unused Docker resources but must not stop or remove any running containers. Which command should you use?
Attempts:
2 left
💡 Hint
Consider what resources each prune command affects.
✗ Incorrect
docker system prune -f removes stopped containers, unused networks, dangling images, and build cache but does not affect running containers.
❓ Troubleshoot
advanced2:00remaining
Why does
docker system prune not remove some unused images?You ran
docker system prune -f but noticed some unused images remain. What is the most likely reason?Attempts:
2 left
💡 Hint
Think about what 'dangling' means for images.
✗ Incorrect
By default, docker system prune removes only dangling images (untagged). Tagged images are kept unless --all is specified.
🔀 Workflow
advanced3:00remaining
What is the correct sequence to safely clean up all unused Docker images, including untagged and tagged, without affecting running containers?
Arrange the following commands in the correct order to clean up all unused Docker images and other unused resources safely.
Attempts:
2 left
💡 Hint
Start by pruning containers and networks before images and system prune.
✗ Incorrect
First remove stopped containers, then unused networks, then all unused images including tagged ones, and finally run system prune to clean build cache and any leftovers.
🧠 Conceptual
expert2:00remaining
What is the effect of running
docker system prune --volumes -f?You execute
docker system prune --volumes -f. What additional cleanup does this command perform compared to docker system prune -f?Attempts:
2 left
💡 Hint
Volumes are not removed by default with system prune.
✗ Incorrect
The --volumes flag adds removal of all unused volumes to the standard system prune cleanup.