docker images,info,-d等命令報錯的解決方法
一、發(fā)現(xiàn)問題
樓主不管輸入那個命令,都出現(xiàn)了:
FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
二、解決方法
以及類似的錯誤,就連docker version
命令都報錯了,樓主開始找啊找,找到了好多東西,結(jié)果發(fā)現(xiàn)沒一個能行的,最后樓主使用這樣的命令:
# vim /etc/default/docker
在該文件中添加如下內(nèi)容:
DOCKER_OPTS="-H unix:///var/run/docker.sock -H 0.0.0.0:5555"
# service docker restart
這樣就行了..我也不知道怎么樣就行了.真的好神奇.
樓主趕快使用了一下
syx@syx-VB:~$ docker version Client version: 1.6.2 Client API version: 1.18 Go version (client): go1.3.3 Git commit (client): 7c8fca2 OS/Arch (client): linux/amd64 Server version: 1.6.2 Server API version: 1.18 Go version (server): go1.3.3 Git commit (server): 7c8fca2 OS/Arch (server): linux/amd64
好神奇,終于可以了,樓主趕快把docker升級到最新版本.
$ sudo add-apt-repository ppa:docker-maint/testing $ sudo apt-get update $ sudo apt-get install docker.io
樓主這樣就行了一次,然后就又不行了樓主開始找原因,這次樓主問了問別了,別人說在ubuntu下安裝一個devicemapper
樓主使用的命令如下:
root@syx-VB:~# apt-get install -y libdevmapper-dev
還是不行啊
root@syx-VB:~# service docker restart root@syx-VB:~# docker version root@syx-VB:~# docker version Client version: 1.7.0-dev Client API version: 1.19 Go version (client): go1.4.2 Git commit (client): 9234460 OS/Arch (client): linux/amd64 FATA[0000] Get http:///var/run/docker.sock/v1.19/version: read unix /var/run/docker.sock: connection reset by peer. Are you trying to connect to a TLS-enabled daemon without TLS?
樓主英語不行,看不懂是啥意思,接著問.
人家告訴樓主使用docker -d
來看看:
root@syx-VB:~# docker -d INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) FATA[0000] Error starting daemon: error initializing graphdriver: "/var/lib/docker" contains other graphdrivers: devicemapper; Please cleanup or explicitly choose storage driver (-s <DRIVER>)
看不懂,接著問大神!!!
大神說了把/var/lib/docker下的devicemapper清掉,樓主一看:
root@syx-VB:/var/lib/docker# ls aufs containers devicemapper graph init linkgraph.db repositories-aufs repositories-devicemapper tmp trust volumes
還真有這個目錄,于是使用:
root@syx-VB:/var/lib/docker# rm -r devicemapper/
接著:
root@syx-VB:/var/lib/docker# docker version Client version: 1.7.0-dev Client API version: 1.19 Go version (client): go1.4.2 Git commit (client): 9234460 OS/Arch (client): linux/amd64 FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
怎么還是不行!!
這個時候樓主重啟了一下docker服務(wù),居然就好了。
root@syx-VB:/var/lib/docker# service docker restart root@syx-VB:/var/lib/docker# docker version
總結(jié)
好了,終于解決了,以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能有所幫助,如果有疑問大家可以留言交流。
相關(guān)文章
解決docker run hello-world遇到錯誤消息-error during&n
這篇文章主要介紹了解決docker run hello-world遇到錯誤消息-error during conne問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-06-06Docker Compose一鍵ELK部署的方法實現(xiàn)
這篇文章主要介紹了Docker Compose一鍵ELK部署的方法實現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-01-01