在启动Docker时报docker.service的作业失败
[root@wzy1303 etc]# systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
Linux使用docker时,报错docker.service 的作业失败,因为控制进程已退出,并返回错误代码,有关详细信息,参阅"systemctl status docker.service"和"journalctl-xe"时,不一定要重装docker
- 首先查看docker当前的状态
[root@wzy1303 etc]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since 一 2024-08-12 10:28:32 CST; 2min 18s ago
Docs: https://docs.docker.com
Process: 106432 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 106432 (code=exited, status=1/FAILURE)
8月 12 10:28:30 wzy1303 systemd[1]: docker.service failed.
8月 12 10:28:32 wzy1303 systemd[1]: docker.service holdoff time over, scheduling restart.
8月 12 10:28:32 wzy1303 systemd[1]: Stopped Docker Application Container Engine.
8月 12 10:28:32 wzy1303 systemd[1]: start request repeated too quickly for docker.service
8月 12 10:28:32 wzy1303 systemd[1]: Failed to start Docker Application Container Engine.
8月 12 10:28:32 wzy1303 systemd[1]: Unit docker.service entered failed state.
8月 12 10:28:32 wzy1303 systemd[1]: docker.service failed.
8月 12 10:29:04 wzy1303 systemd[1]: start request repeated too quickly for docker.service
8月 12 10:29:04 wzy1303 systemd[1]: Failed to start Docker Application Container Engine.
8月 12 10:29:04 wzy1303 systemd[1]: docker.service failed.
[root@wzy1303 etc]# systemctl status docker -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since 一 2024-08-12 10:28:32 CST; 2min 54s ago
Docs: https://docs.docker.com
Process: 106432 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 106432 (code=exited, status=1/FAILURE)
8月 12 10:28:30 wzy1303 systemd[1]: docker.service failed.
8月 12 10:28:32 wzy1303 systemd[1]: docker.service holdoff time over, scheduling restart.
8月 12 10:28:32 wzy1303 systemd[1]: Stopped Docker Application Container Engine.
8月 12 10:28:32 wzy1303 systemd[1]: start request repeated too quickly for docker.service
8月 12 10:28:32 wzy1303 systemd[1]: Failed to start Docker Application Container Engine.
8月 12 10:28:32 wzy1303 systemd[1]: Unit docker.service entered failed state.
8月 12 10:28:32 wzy1303 systemd[1]: docker.service failed.
8月 12 10:29:04 wzy1303 systemd[1]: start request repeated too quickly for docker.service
8月 12 10:29:04 wzy1303 systemd[1]: Failed to start Docker Application Container Engine.
8月 12 10:29:04 wzy1303 systemd[1]: docker.service failed.
- Active: failed :表示docker没有启动成功
- 进入/etc/docker目录,发现deamon.jso文件不存在
[root@wzy1303 etc]# cd docker/
[root@wzy1303 docker]# vim daemon.json.rpmsave
- 在deamon.json.rpmsave文件中提加上镜像源
{
"registry-mirrors": ["http://f1361db2.m.daocloud.od"]
}
- 再重新启动docker服务
systemctl restart docker