Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error response from daemon: network myapp not found

Tags:

docker

I am trying to create a container in a multihost network but while creating I am getting this error:

Error response from daemon: network myapp not found

Here myapp is the name of overlay network which i have created. The command I am using is:

sudo docker run --rm -it --name=test_cont --net=myapp ubuntu bash
like image 666
Abhay Dwivedi Avatar asked Sep 22 '16 13:09

Abhay Dwivedi


1 Answers

I started getting this error after doing a docker system prune.

docker network ls showed my network:

NETWORK ID          NAME                DRIVER              SCOPE
pgl0gb0mbwql        myapp               overlay             swarm

But deploying the stack would give error like:

failed to create service myapp_database: Error response from daemon: network myapp not found

Then I asked myself the most important debugging question there is: Have you tried turning it off and on again?

I restarted my docker daemon and the network was deleted for real. I was then able to re-create it and everything started working again.

like image 195
bohendo Avatar answered Sep 30 '22 06:09

bohendo