当前位置:论坛首页 > Linux面板 > 求助

【待反馈】docker安装失败

发表在 Linux面板2024-7-3 21:22 [复制链接] 8 710

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:

免费免费版 8.2.0
系统版本:

系统:Ubuntu 18.04.6 LTS (Bionic Beaver) x86_64(Py3.7.8)
问题描述:

安装docker失败 无法启动
相关截图(日志、错误):

安装失败,文件不存在:/usr/lib/systemd/system/docker.service




使用道具 举报 只看该作者 回复
发表于 2024-7-3 21:24:37 | 显示全部楼层
失败截图
屏幕截图 2024-07-03 212025.png
使用道具 举报 回复
发表于 2024-7-4 09:55:34 | 显示全部楼层

您好,您执行以下命令解禁一下
  1. sudo systemctl unmask docker.service
  2. sudo systemctl unmask docker.socket
  3. sudo systemctl unmask containerd.service
复制代码

提示的文件不存在可以手动创建一个
  1. sudo mkdir -p /etc/docker  
  2. sudo touch /etc/docker/daemon.json  
  3. sudo nano /etc/docker/daemon.json
复制代码

在文件里边写入
{  
  "registry-mirrors": ["https://<your-mirror-url>.mirror.aliyuncs.com"]  
}
替换 <your-mirror-url> 为你的镜像加速器地址。

然后逐条执行以下命令
  1. sudo systemctl enable docker.service  
  2. sudo systemctl enable docker.socket  
  3. sudo systemctl enable containerd.service  

  4. sudo systemctl start docker.service
复制代码


最后检查一下是否正确
  1. docker --version
复制代码
使用道具 举报 回复 支持 反对
发表于 2024-7-8 14:58:28 | 显示全部楼层
执行命令失败
屏幕截图 2024-07-06 111032.png
使用道具 举报 回复 支持 反对
发表于 2024-7-8 14:59:25 | 显示全部楼层
运维技术阿闯 发表于 2024-7-4 09:55
您好,您执行以下命令解禁一下

提示的文件不存在可以手动创建一个

执行命令失败
屏幕截图 2024-07-06 111032.png
使用道具 举报 回复 支持 反对
发表于 2024-7-8 15:47:06 | 显示全部楼层

您好,应该是您这边就没有下载下来,重新安装一下docker,这次使用二进制方式手动安装
https://blog.csdn.net/qiuchenjun/article/details/128107633
使用道具 举报 回复 支持 反对
发表于 2024-7-21 18:52:01 | 显示全部楼层
既然 Docker 已经安装了,但你还是收到 Unit docker.service not found 的错误消息,这可能是由于 Docker 服务文件没有正确安装或配置。以下是你可以采取的步骤来解决这个问题:

1. 检查 Docker 服务文件
确认 Docker 服务文件是否存在于正确的位置:

bash
复制代码
ls /lib/systemd/system/docker.service


bash
复制代码
ls /etc/systemd/system/docker.service
2. 手动创建 Docker 服务文件
如果服务文件不存在,你可以手动创建它。创建一个名为 docker.service 的文件并添加以下内容:

bash
复制代码
sudo nano /lib/systemd/system/docker.service
然后添加以下内容:

ini
复制代码
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/dockerd -H unix://
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target
保存并退出编辑器。

3. 重新加载 Systemd 并启动 Docker
bash
复制代码
sudo systemctl daemon-reload
sudo systemctl start docker
sudo systemctl enable docker
4. 检查 Docker 服务状态
bash
复制代码
sudo systemctl status docker
如果服务启动成功,你应该看到 Docker 服务正在运行。

5. 重启 Docker
现在你可以重启 Docker 了。

bash
复制代码
sudo systemctl restart docker
如果上述步骤仍然无法解决问题,请提供更多细节,以便进一步排查。
使用道具 举报 回复 支持 反对
发表于 2024-7-21 18:52:41 | 显示全部楼层
宝塔用户_eoykcz 发表于 2024-7-21 18:52
既然 Docker 已经安装了,但你还是收到 Unit docker.service not found 的错误消息,这可能是由于 Docker  ...

我这样解决了
使用道具 举报 回复 支持 反对
发表于 2024-7-22 11:51:36 | 显示全部楼层

感谢您的问题解决思路,我们等待楼主回复即可
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理

工作时间:09:00至24:00

快速回复 返回顶部 返回列表