Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-compose down - network is external, skipping

I'm trying bring down all services for an external network defined in my docker-compose file (using version 2).

When I try to do a docker-compose down, I get a message stating,

Network 'your_network' is external, skipping

Is there a way, using docker-compose, to stop and remove all the containers for a user-defined or external network?

like image 857
sager89 Avatar asked Mar 30 '16 20:03

sager89


2 Answers

I've encountered the same error. docker-compose can only stop the containers started by docker-compose. In my case: the containers that I wanted to stop were started by docker run. So I stopped the containers one by one. then started them with the docker-compose.yml

Not sure if you are the same case.

like image 73
Justin Zhang Avatar answered Oct 13 '22 12:10

Justin Zhang


This isn't an error. You have a network declared as "external", mostly meaning that it may be used by other services or other docker-compose files. So when you stop those services, the network gets "skipped", because the network is shared among all services that reference it, and it would create an error to try to delete the external network.

like image 27
rfay Avatar answered Oct 13 '22 13:10

rfay