service docker start后docker stop/waiting的解决方法

在某次强行对机子断电后,再开机后发现docker没启动

运行service docker start显示docker start/running, process xxxx,之后不一会儿就停止了,

再运行service docker status显示docker stop/waiting

这时候使用docker -d或者docker daemon来查看错误

Warning: '-d' is deprecated, it will be removed soon. See usage.
WARN[0000] please use 'docker daemon' instead.          
INFO[0000] [graphdriver] using prior storage driver "aufs" 
INFO[0000] API listen on /var/run/docker.sock           
INFO[0000] Firewalld running: false                     
FATA[0000] Error starting daemon: Error initializing network controller: could not delete the default bridge network: network bridge has active endpoints

这里关键是Error starting daemon: Error initializing network controller: could not delete the default bridge network: network bridge has active endpoints

是docker的网络出现问题,解决方法如下:

rm -rf /var/lib/docker/network/files/*
service docker start