当前位置:   article > 正文

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running

cannot connect to the docker daemon at unix:///var/run/docker.sock. is the d

当docker  ps出现Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running以下报错时,首先

systemctl  status   docker

查看docker服务的状态如果处于关闭状态则需要启动docker服务

systemctl  start  docker

如果服务是启动状态docker   ps还是报这个错

  1. vim /usr/lib/systemd/system/docker.service
  2. [Unit]
  3. Description=Docker Application Container Engine
  4. Documentation=https://docs.docker.com
  5. After=network-online.target docker.socket firewalld.service containerd.service time-set.target
  6. Wants=network-online.target containerd.service
  7. Requires=docker.socket
  8. [Service]
  9. Type=notify
  10. # the default is not to use systemd for cgroups because the delegate issues still
  11. # exists and systemd currently does not support the cgroup feature set required
  12. # for containers run by docker
  13. ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
  14. #此处的sock文件有两处确认一下自己的在/run下面还是/container下面
  15. ExecReload=/bin/kill -s HUP $MAINPID

如果路径ok,那就是docker.socket进程没有关掉

  1. systemctl stop docker.socket #停掉docker.socket进程
  2. systemctl stop docker #同时把docker也停掉

重新启动服务即可

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/265772
推荐阅读
相关标签
  

闽ICP备14008679号