Docker启动出现错误

问题:

[root@VM-4-15-centos ~]# systemctl start docker.service
Failed to start docker.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status docker.service' for details.

解决办法:删除这个文件

rm -rf /etc/systemd/system/docker.service

参考文献:

docker.service启动失败:Unit not found的原因及解决办法 - fat_girl_spring - 博客园 (cnblogs.com)

附录

Last failed login: Fri Aug 23 10:59:40 CST 2024 from 58.75.221.5 on ssh:notty
There were 25 failed login attempts since the last successful login.
Last login: Thu Aug 22 16:02:24 2024 from 
[root@VM-4-15-centos ~]# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@VM-4-15-centos ~]# systemctl start docker.service
Failed to start docker.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status docker.service' for details.
[root@VM-4-15-centos ~]# systemctl start docker
Failed to start docker.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status docker.service' for details.
[root@VM-4-15-centos ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: error (Reason: Invalid argument)
   Active: failed (Result: start-limit) since Thu 2024-08-22 16:24:31 CST; 19h ago
     Docs: https://docs.docker.com
 Main PID: 15501 (code=exited, status=1/FAILURE)

Aug 22 16:24:29 VM-4-15-centos systemd[1]: Failed to start Docker Application Contain...e.
Aug 22 16:24:29 VM-4-15-centos systemd[1]: Unit docker.service entered failed state.
Aug 22 16:24:29 VM-4-15-centos systemd[1]: docker.service failed.
Aug 22 16:24:31 VM-4-15-centos systemd[1]: docker.service holdoff time over, scheduli...t.
Aug 22 16:24:31 VM-4-15-centos systemd[1]: Stopped Docker Application Container Engine.
Aug 22 16:24:31 VM-4-15-centos systemd[1]: start request repeated too quickly for doc...ce
Aug 22 16:24:31 VM-4-15-centos systemd[1]: Failed to start Docker Application Contain...e.
Aug 22 16:24:31 VM-4-15-centos systemd[1]: Unit docker.service entered failed state.
Aug 22 16:24:31 VM-4-15-centos systemd[1]: docker.service failed.
Aug 22 16:33:16 VM-4-15-centos systemd[1]: docker.service lacks both ExecStart= and E...g.
Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Hint: Some lines were ellipsized, use -l to show in full.
[root@VM-4-15-centos ~]# sudo systemctl start docker
Failed to start docker.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status docker.service' for details.
[root@VM-4-15-centos ~]# rm -rf /etc/systemd/system/docker.service
[root@VM-4-15-centos ~]# systemctl start docker.service
Failed to start docker.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status docker.service' for details.
[root@VM-4-15-centos ~]# systemctl daemon-reload
[root@VM-4-15-centos ~]# systemctl start docker.service
[root@VM-4-15-centos ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2024-08-23 12:09:52 CST; 12s ago
     Docs: https://docs.docker.com
 Main PID: 13542 (dockerd)
    Tasks: 8
   Memory: 28.5M
   CGroup: /system.slice/docker.service
           └─13542 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.so...

Aug 23 12:09:50 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:50.077378676+08...g"
Aug 23 12:09:51 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:51.134389544+08...g"
Aug 23 12:09:51 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:51.200725011+08...g"
Aug 23 12:09:51 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:51.717812672+08...s"
Aug 23 12:09:51 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:51.921443064+08...g"
Aug 23 12:09:52 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:52.055830403+08...."
Aug 23 12:09:52 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:52.114176741+08....7
Aug 23 12:09:52 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:52.123553779+08...n"
Aug 23 12:09:52 VM-4-15-centos dockerd[13542]: time="2024-08-23T12:09:52.169868887+08...k"
Aug 23 12:09:52 VM-4-15-centos systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@VM-4-15-centos ~]# 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值