我昨天在Ubuntu 12.04上安装了新版本的Docker(1.9.0)。但是当我运行任何docker命令时,它们总是会显示以下日志,也许docker客户端无法连接到docker守护程序:
root@localhost:$docker ps
An error occurred trying to connect: Get `http:///var/run/docker.sock/v1.21/containers/json: read unix /var/run/docker.sock: connection reset by peer`
root@localhost:$ docker version
Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.2
Git commit: 76d6bc9
Built: Tue Nov 3 17:40:31 UTC 2015
OS/Arch: linux/amd64
An error occurred trying to connect: Get http:///var/run/docker.sock/v1.21/version: read unix /var/run/docker.sock: connection reset by peer
答案 0 :(得分:4)
我们遇到了同样的问题,这解决了(在ubuntu上可靠):https://github.com/docker/docker/issues/17846#issuecomment-155233858
sudo service docker stop
sudo rm /var/lib/docker/network/files/local-kv.db
sudo service docker start
答案 1 :(得分:0)
最后我发现了问题,
在版本1.9中,docker更改其网络接口的IP地址(在主机上键入docker0
时可以看到ifconfig
)到172.17.0.1
而不是先前版本的172.17.42.1