偶然一次輸入docker ps的時候,出現 “Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”錯誤,試過執行
service docker start 命令,啟動docker服務,
返回
解決方法:查看docker日記
tail -5f /var/log/upstart/docker.log
output
time="2020-05-18T09:42:35.148670130+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc time="2020-05-18T09:42:35.148707378+08:00" level=info msg="pickfirstBalancer: Ha ndleSubConnStateChange: 0xc420372530, CONNECTING" module=grpc time="2020-05-18T09:42:35.148827393+08:00" level=info msg="pickfirstBalancer: Ha ndleSubConnStateChange: 0xc420372530, READY" module=grpc time="2020-05-18T09:42:35.148849129+08:00" level=info msg="Loading containers: s tart." Error starting daemon: Error initializing network controller: error obtaining co ntroller instance: failed to get bridge network configurations from store: error while populating kmap: invalid database
出現上述黃色標注的錯誤,執行
rm -rf /var/lib/docker/network/files/* service docker start
docker ps
不在出現“Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”問題解決