docker-compose up失败,提示network not found

在启动一个容器的时候提示 network xxx not found



$ docker-compose up 
Starting yachaoonline-php5.6 ... error

ERROR: for yachaoonline-php5.6  Cannot start service app: network edb946210ef3e67fbb1db9ab6aee1a8475d3bf0b73a5d70794c32636b99722f9 not found

ERROR: for app  Cannot start service app: network edb946210ef3e67fbb1db9ab6aee1a8475d3bf0b73a5d70794c32636b99722f9 not found
ERROR: Encountered errors while bringing up the project.

因为很久没启动这个项目了,估计是该网络被删除。尝试以下命令进行修复

先查看网络

docker network ls

发现网络还在,但id已经修改了。执行 dokcer network prune进行清楚,仍旧无法清除。然后执行一下命令进行系统清理。

docker system prune

然后重新启动,问题解决。