What does the docker system prune command do?

Prepare for the KCNA Certification Test. Study with flashcards, multiple-choice questions, and detailed explanations to enhance your understanding of Kubernetes Cloud Native concepts. Ace your exam!

Multiple Choice

What does the docker system prune command do?

Explanation:
Pruning in Docker helps reclaim disk space by removing data that isn’t needed anymore. The docker system prune command specifically cleans up stopped containers, networks not used by any container, dangling images (those without tags or not referenced by any container), and dangling build cache. It won’t touch running containers or images still in use, and it doesn’t reset Docker to factory defaults or delete log files inside containers. It also doesn’t remove all images—only those that are unused or dangling. If you want to remove more aggressively, you can add -a to include unused images in general, not just dangling ones, and you can use -f to skip the confirmation prompt.

Pruning in Docker helps reclaim disk space by removing data that isn’t needed anymore. The docker system prune command specifically cleans up stopped containers, networks not used by any container, dangling images (those without tags or not referenced by any container), and dangling build cache. It won’t touch running containers or images still in use, and it doesn’t reset Docker to factory defaults or delete log files inside containers. It also doesn’t remove all images—only those that are unused or dangling. If you want to remove more aggressively, you can add -a to include unused images in general, not just dangling ones, and you can use -f to skip the confirmation prompt.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy