docker安装启动问题解决排查

一、安装docker报错

刚开始安装docker报这个错:

Error: Transaction test error:

file /usr/libexec/docker/cli-plugins/docker-buildx from install of docker-ce-cli-1:20.10.8-3.el8.x86_64 conflicts with file from package docker-buildx-plugin-0:0.14.0-1.el8.x86_64

根据错误显示发现插件冲突了,删除插件

yum remove docker-buildx-plugin-0:0.14.0-1.el8.x86_64

结果如下:

再次安装

yum install docker-ce-20.10.8-3.el8 docker-ce-cli-20.10.8-3.el8

显示成功

但是无法启动

二、启动问题

使用命令启动结果报错

sudo systemctl start docker

查看状态和错误

但看状态无法发现是什么原因,去查看具体原因

journalctl -u docker.service

结果如下:

-- Logs begin at Wed 2024-12-04 03:55:58 CST, end at Fri 2024-12-06 11:31:04 CST. --

Dec 06 10:43:55 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:43:55 node2 dockerd[3353521]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:43:55 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:43:55 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:43:55 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:43:58 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:43:58 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.

Dec 06 10:43:58 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:43:58 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:43:58 node2 dockerd[3353564]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:43:58 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:43:58 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:43:58 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:44:00 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:44:00 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.

Dec 06 10:44:00 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:44:00 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:44:00 node2 dockerd[3353590]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:44:00 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:44:00 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:44:00 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.

Dec 06 10:44:02 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Start request repeated too quickly.

Dec 06 10:44:02 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:44:02 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:45:00 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:45:00 node2 dockerd[3353939]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:45:00 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:45:00 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:45:00 node2 systemd[1]: Failed to start Docker Application Container Engine.

Dec 06 10:45:02 node2 systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.

Dec 06 10:45:02 node2 systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.

Dec 06 10:45:02 node2 systemd[1]: Stopped Docker Application Container Engine.

Dec 06 10:45:02 node2 systemd[1]: Starting Docker Application Container Engine...

Dec 06 10:45:02 node2 dockerd[3353993]: failed to start daemon: failed to dial "/run/containerd/containerd.sock": unknown service containerd.services.namespaces.v1.Namespaces: not implemented

Dec 06 10:45:02 node2 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Dec 06 10:45:02 node2 systemd[1]: docker.service: Failed with result 'exit-code'.

Dec 06 10:45:02 node2 systemd[1]: Failed to start Docker Application Container Engine.

根据这个报错failed to start daemon: failed to dial "/run/containerd/containerd.sock"去查看,以为是没启动,结果查看是启动的

systemctl status containerd

查看结果如下:

去查看containerd.sock相关权限

执行下列操作:

sudo chown root:docker /run/containerd/containerd.sock

然后直接重启

systemctl restart containerd

结果还是一样:

最后发现需要先停止在重启才能奏效

[root@node2 ~]# systemctl stop containerd
[root@node2 ~]# systemctl start containerd
[root@node2 ~]# systemctl start docker.service

此时查看docker状态已经running了

相关推荐
?-ldl2 分钟前
docker使用笔记
笔记·docker·容器
雷神乐乐6 分钟前
Java操作Excel导入导出——POI、Hutool、EasyExcel
java·开发语言·spring boot·poi·easyexcel·hutool
Devil_MayCare7 分钟前
Docker配置国内镜像源
docker·容器
xiao-xiang8 分钟前
Jenkins-pipeline Jenkinsfile说明
运维·jenkins
里音日黑9 分钟前
Elasticsearch 和arkime 安装
linux·运维·服务器·elasticsearch·arkime
小丁爱养花28 分钟前
JVM 面试八股文
java·jvm·面试
Q_274378510934 分钟前
基于Spring Boot的车间调度管理系统
java·spring boot·后端
我是苹果,不是香蕉35 分钟前
vim将一行行尾倒数第三个字符替换成1
linux·编辑器·vim
冰淇淋百宝箱38 分钟前
GraphRAG: Auto Prompt Tuning 实践
java·服务器·前端
S-X-S1 小时前
日志模块新增配置日志根目录和项目模块功能
java·日志