root:/home/lzw# sudo systemctl restart docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.

1、问题描述
启动docker服务: 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.

2、问题解决
1、进入docker目录:cd /etc/docker/

2、修改daemon的类型:mv daemon.json daemon.conf

3、重启docker:systemctl restart docker

我的就是这样解决的。其他百度的方式不行。

上述修改如下:
上述确实解决了这个无法启动的问题,但是又出现了镜像没有配置成功,导致连helloworld的镜像都无法拉取。查阅了多个资料,发现文件daemon.json这样并没有错,大家都是如此。
然后仔细查阅文件的内容,发现有一个镜像地址后面少了一个英文逗号,简直了,如下所示:

sudo tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://docker.1ms.run",
        "https://docker.1panel.live",
        "https://docker.iyuu.cn",
        "https://docker.5s6.com",
        "https://d.rakin.cn"  #就是这里忘记了逗号
        "https://docker.1panel.dev",
        "https://docker.foreverlink.love",
        "https://dytt.online",
        "https://func.ink",
        "https://lispy.org",
        "https://docker.xiaogenban1993.com",
        "https://docker.xn--6oq72ry9d5zx.cn",
        "https://docker.zhai.cm",
        "https://docker.5z5f.com",
        "https://a.ussh.net",
        "https://docker.cloudlayer.icu",
        "https://docker.linkedbus.com",
        "https://docker.m.daocloud.io"
    ]
}
EOF

Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐