赞
踩
问题:docker突然启动不了,然后也用不了docker的命令,报错如下。
[root@master opt]# docker network ls
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
1.检查docker的运行状态
[root@master opt]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2022-12-01 21:45:45 CST; 12s ago
Docs: Docker Documentation | Docker Documentation
Process: 2259 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.so>
Main PID: 2259 (code=exited, status=1/FAILURE)
12月 01 21:45:43 master systemd[1]: docker.service: Main process exited, code=exited, status=1>
12月 01 21:45:43 master systemd[1]: docker.service: Failed with result 'exit-code'.
12月 01 21:45:43 master systemd[1]: Failed to start Docker Application Container Engine.
12月 01 21:45:45 master systemd[1]: docker.service: Service RestartSec=2s expired, scheduling >
12月 01 21:45:45 master systemd[1]: docker.service: Scheduled restart job, restart counter is >
12月 01 21:45:45 master systemd[1]: Stopped Docker Application Container Engine.
12月 01 21:45:45 master systemd[1]: docker.service: Start request repeated too quickly.
12月 01 21:45:45 master systemd[1]: docker.service: Failed with result 'exit-code'.
12月 01 21:45:45 master systemd[1]: Failed to start Docker Application Container Engine.
2.尝试重启docker服务
启动报错如下
[root@master opt]# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
解决方案:
修改配置文件后缀 --->把/etc/docker/daemon.json文件的.json后缀,修改为.conf后缀
[root@master ~]# mv /etc/docker/daemon.json /etc/docker/daemon.conf
成功启动docker服务
[root@master ~]# systemctl start docker
查询docker服务状态
[root@master ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2022-12-01 22:03:20 CST; 7s ago
Docs: Docker Documentation | Docker Documentation
Main PID: 1723 (dockerd)
Tasks: 26
Memory: 51.1M
CGroup: /system.slice/docker.service
├─1723 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
├─1988 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5000 -container>
└─1994 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 5000 -container-ip 1>
12月 01 22:03:18 master dockerd[1723]: time="2022-12-01T22:03:18.289854312+08:00" level=warnin>
12月 01 22:03:18 master dockerd[1723]: time="2022-12-01T22:03:18.290249654+08:00" level=info m>
12月 01 22:03:19 master dockerd[1723]: time="2022-12-01T22:03:19.277350833+08:00" level=info m>
12月 01 22:03:19 master dockerd[1723]: time="2022-12-01T22:03:19.297006452+08:00" level=warnin>
12月 01 22:03:19 master dockerd[1723]: time="2022-12-01T22:03:19.352761031+08:00" level=info m>
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.154534118+08:00" level=info m>
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.427561039+08:00" level=info m>
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.427731869+08:00" level=info m>
12月 01 22:03:20 master systemd[1]: Started Docker Application Container Engine.
12月 01 22:03:20 master dockerd[1723]: time="2022-12-01T22:03:20.499788277+08:00" level=info m>
lines 1-22/22 (END)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。