给docker配置了镜像加速器以后无法启动

文章讲述了在Linux系统中,Docker服务启动失败的问题,原因是SELinux启用导致的,通过编辑docker.service配置文件,将SELinux设置为禁用并指定不安全的镜像注册,然后重启systemd以解决问题。
摘要由CSDN通过智能技术生成
[root@linux ~]# systemctl status docker.service

● docker.service - Docker Application Container Engine

   Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: disabled)

   Active: failed (Result: start-limit) since 六 2023-11-18 13:00:51 CST; 2min 51s ago

     Docs: https://docs.docker.com

  Process: 2628 ExecStart=/usr/bin/dockerd --registry-mirror=<your accelerate address> --registry-mirror=<your accelerate address> -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)

 Main PID: 2628 (code=exited, status=1/FAILURE)



11月 18 13:00:49 linux systemd[1]: docker.service failed.

11月 18 13:00:51 linux systemd[1]: docker.service holdoff time over, scheduling restart.

11月 18 13:00:51 linux systemd[1]: Stopped Docker Application Container Engine.

11月 18 13:00:51 linux systemd[1]: start request repeated too quickly for docker.service

11月 18 13:00:51 linux systemd[1]: Failed to start Docker Application Container Engine.

11月 18 13:00:51 linux systemd[1]: Unit docker.service entered failed state.

11月 18 13:00:51 linux systemd[1]: docker.service failed.

11月 18 13:00:51 linux systemd[1]: start request repeated too quickly for docker.service

11月 18 13:00:51 linux systemd[1]: Failed to start Docker Application Container Engine.

11月 18 13:00:51 linux systemd[1]: docker.service failed.

Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.

[root@linux ~]# systemctl restart docker

Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.

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 ~]# 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.

出现以上错误时,需要如下配置即可解决

需要进入如下目录:vim /etc/systemd/system/docker.service

ExecStart=/usr/bin/dockerd --selinux-enabled=false --insecure-registry=11.0.1.10

# --insecure-registry的值修改为自己本机(虚拟机)IP

最后启动docker

[root@linux ~]# systemctl daemon-reload

[root@linux ~]# systemctl restart docker

  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值