C:\>docker network rm network_name
Eresponse from daemon: network network_name has active endpointsThis error comes when you have an active endpoint. First you have to inspect the network to check if any container is still running which is using the network.
docker inspect network_nameCheck running containers using
docker container lsIf you find any container running which is using the network that you are trying to delete, you will have to first stop and remove that container. Be sure that you don’t need that container.
docker stop container_name
docker rm container_nameIf you don’t see any container running with the name given in the inspect output. Than it means that the container that you deleted earlier was not removed properly and it has traces remaining in network.
To remove the endpoint from network run this command.
docker network disconnect --force network_name container_nameFinally you should be able to remove the network now.
docker network rm network_name