Error response from daemon: service endpoint with name

docker network inspect <network name>
docker network disconnect <network name> <container id/ container name>

You can also try doing:

docker network prune
docker volume prune
docker system prune 

these commands will help clearing zombie containers, volume and network. When no command works then do

sudo service docker restart

your problem will be solved


TLDR: restart your docker daemon or restart your docker-machine (if you're using that e.g. on a mac).

Edit: As there are more recent posts below, they answer the question better then mine. The Network adapter is stuck on the daemon. I'm updating mine as its possibly 'on top' of the list and people might not scroll down.

  1. Restarting your docker daemon / docker service / docker-machine is the easiest answer.

  2. the better answer (via Shalabh Negi):

docker network inspect <network name>
docker network disconnect <network name> <container id/ container name>

This is also faster in real time if you can find the network as restarting the docker machine/demon/service in my experience is a slow thing. If you use that, please scroll down and click +1 on their answer.


So the problem is probably your network adapter (virtual, docker thing, not real): have a quick peek at this: https://github.com/moby/moby/issues/23302.

To prevent it happening again is a bit tricky. It seems there may be an issue with docker where a container exits with a bad status code (e.g. non-zero) that holds the network open. You can't then start a new container with that endpoint.


Just in case someone else needs this. As @Jmons pointed out it was a weird networking issue. So I solved this by forcing a removal

docker network disconnect --force bridge qc.T8

A

Tags:

Docker