赞
踩
当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还是报这个错
- vim /usr/lib/systemd/system/docker.service
-
-
- [Unit]
- Description=Docker Application Container Engine
- Documentation=https://docs.docker.com
- After=network-online.target docker.socket firewalld.service containerd.service time-set.target
- Wants=network-online.target containerd.service
- Requires=docker.socket
-
- [Service]
- Type=notify
- # the default is not to use systemd for cgroups because the delegate issues still
- # exists and systemd currently does not support the cgroup feature set required
- # for containers run by docker
- ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
- #此处的sock文件有两处确认一下自己的在/run下面还是/container下面
- ExecReload=/bin/kill -s HUP $MAINPID
如果路径ok,那就是docker.socket进程没有关掉
- systemctl stop docker.socket #停掉docker.socket进程
- systemctl stop docker #同时把docker也停掉
重新启动服务即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。