關於docker啟動失敗問題處理


docker info命令
輸出顯示:
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
本次解決問題的資料:
關於Docker啟動報錯:docker.socket: Failed to listen on sockets: Address already in use
https://www.cnblogs.com/Conwie/p/14462232.html
 
不能解決的網上資料:
網上查了一堆資料,沒找到解決方法
編輯 vim /etc/docker/daemon.json (解決不了)
https://blog.csdn.net/sdrfengmi/article/details/87929593

寫在docker后重新安裝   (不考慮)

添加docker用戶組    (已經有用戶組了)
https://www.dazhuanlan.com/2019/12/31/5e0b0af5a3191/

還有修改 vi /etc/sysconfig/selinux文件信息的(不考慮)
https://blog.csdn.net/qq_40996741/article/details/98473966

 

然后想着先停掉docker服務。
停服務時候報錯了
systemctl stop  docker.service
Warning: Stopping docker.service, but it can still be activated by:
  docker.socket

docker服務還是存活了,根據docker.socket文件。

 

接着啟動docker服務
systemctl start  docker.service
錯誤信息如下:
A dependency job for docker.service failed. See 'journalctl -xe' for details

 

systemctl status docker.service
查看服務狀態:
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Tue 2021-06-08 09:53:44 CST; 10min ago
     Docs: https://docs.docker.com
Main PID: 4695 (code=exited, status=0/SUCCESS)


Jun 08 09:53:42 VM-0-13-centos dockerd[4695]: time="2021-06-08T09:53:42.8864784..."
Jun 08 09:53:42 VM-0-13-centos dockerd[4695]: time="2021-06-08T09:53:42.9251783..."
Jun 08 09:53:44 VM-0-13-centos dockerd[4695]: time="2021-06-08T09:53:44.9135121..."
Jun 08 09:53:44 VM-0-13-centos systemd[1]: Stopped Docker Application Container....
Jun 08 09:57:52 VM-0-13-centos systemd[1]: Dependency failed for Docker Applica....
Jun 08 09:57:52 VM-0-13-centos systemd[1]: Job docker.service/start failed with....
Jun 08 10:01:29 VM-0-13-centos systemd[1]: Dependency failed for Docker Applica....
Jun 08 10:01:29 VM-0-13-centos systemd[1]: Job docker.service/start failed with....
Jun 08 10:03:09 VM-0-13-centos systemd[1]: Dependency failed for Docker Applica....
Jun 08 10:03:09 VM-0-13-centos systemd[1]: Job docker.service/start failed with....
Hint: Some lines were ellipsized, use -l to show in full

看不出來錯誤信息

然后使用 journalctl -xe 命令查看系統日志信息
 
主要就是紅框里
Jun 08 10:08:41 VM-0-13-centos systemd[1]: docker.socket failed to listen on sockets: Address already in use
Jun 08 10:08:41 VM-0-13-centos systemd[1]: Failed to listen on Docker Socket for the API.
錯誤提示:監聽socket時,發現地址已經被使用。
 
然后去查看 /var/run/ 目錄的docker文件
發現docker.sock 文件變成的目錄 docker.dock/
 
刪除這個目錄就可以解決問題
rm -rf /var/run/docker.sock/
 
然后能正常啟動docker服務
systemctl restart docker

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM