"error while removing network: network ... has active endpoints" means a container is still attached - stop/remove it first, then rm the network. You cannot remove the built-in bridge, host, or none. For bulk cleanup of leftover compose networks, docker network prune -f is simpler than individual rm.
docker network rm deletes networks. This page covers the active-endpoints error and how prune differs.
What it does?
docker network rm removes one or more user-defined networks. A network with connected containers cannot be removed until they disconnect or stop.
Common errors in CI?
"error while removing network: network ... has active endpoints" means a container is still attached - stop/remove it first, then rm the network. You cannot remove the built-in bridge, host, or none. For bulk cleanup of leftover compose networks, docker network prune -f is simpler than individual rm.