Skip to main content

How does Docker clean up unused networks and why do they accumulate?

Mid Docker
Quick Answer Docker creates a network for each Compose project or docker network create call. When containers are removed but networks aren't explicitly removed, the networks linger รขโ‚ฌโ€ empty but taking up namespace. docker network prune removes all networks with no containers. Many CI runs create networks without cleaning them up.

Answer

Networks persist after containers are removed; docker network prune cleans them.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice