Ubuntu Docker ‘Job for docker.service failed because the control process exited with error code‘解决方案

尝试安装Docker或尝试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.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2024-05-09 00:51:02 CST; 8ms ago
     Docs: https://docs.docker.com
  Process: 14984 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 14984 (code=exited, status=1/FAILURE)

5月 09 00:51:02 zrf-virtual-machine systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
5月 09 00:51:02 zrf-virtual-machine systemd[1]: docker.service: Failed with result 'exit-code'.
5月 09 00:51:02 zrf-virtual-machine systemd[1]: Failed to start Docker Application Container Engine.

解决方案:

  1. 卸载重新安装
  2. 1不起作用的情况下,kill掉所有docker进程。
ps -ef | grep docker
  1. 给docker.sock授权
sudo chown $USER:$USER /var/run/docker.sock

4.(可选)删掉lib文件,禁用防火墙

sudo rm -rf /var/lib/docker
sudo ufw disable
  1. 重启docker
sudo systemctl stop docker
sudo systemctl start docker
  1. 尝试启动hello
sudo docker run hello-world

能跑起来就没问题了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值