启动docker时报错:Job for docker.service Job for docker.service failed because the con

392 阅读1分钟

错误描述:

[root@linux-local ~]# 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.
[root@linux-local ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since 日 2022-10-30 20:02:49 CST; 1min 16s ago
     Docs: https://docs.docker.com
  Process: 7346 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock (code=exited, status=1/FAILURE)
 Main PID: 7346 (code=exited, status=1/FAILURE)

10月 30 20:02:47 linux-local systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
10月 30 20:02:47 linux-local systemd[1]: Failed to start Docker Application Container Engine.
10月 30 20:02:47 linux-local systemd[1]: Unit docker.service entered failed state.
10月 30 20:02:47 linux-local systemd[1]: docker.service failed.
10月 30 20:02:49 linux-local systemd[1]: docker.service holdoff time over, scheduling restart.
10月 30 20:02:49 linux-local systemd[1]: Stopped Docker Application Container Engine.
10月 30 20:02:49 linux-local systemd[1]: start request repeated too quickly for docker.service
10月 30 20:02:49 linux-local systemd[1]: Failed to start Docker Application Container Engine.
10月 30 20:02:49 linux-local systemd[1]: Unit docker.service entered failed state.
10月 30 20:02:49 linux-local systemd[1]: docker.service failed. 

问题原因:

daemon.json文件包含格式不正确的JSON,导致docker无法启动

解决办法:

1.systemctl stop docker.service

2.vim /etc/docker/daemon.json
{
  "insecure-registries": ["192.168.1.35:5000"]
}

3.systemctl daemon-reload

4.systemctl restart docker.service