【CentOS8下Docker安装的问题】download.docker.com port 443: 拒绝连接,出现和Podman冲突,软件包的问题 containers-common

[root@localhost ~]# sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile docker-ce-stable | 3.5 kB 00:00:00 (1/2): docker-ce-stable/7/x86_64/updateinfo | 55 B 00:00:00 (2/2): docker-ce-stable/7/x86_64/primary_db | 152 kB 00:00:00 正在解决依赖关系 --> 正在检查事务 ---> 软件包 containerd.io.x86_64.0.1.6.33-3.1.el7 将被 安装 --> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.6.33-3.1.el7.x86_64 需要 ---> 软件包 docker-buildx-plugin.x86_64.0.0.14.1-1.el7 将被 安装 ---> 软件包 docker-ce.x86_64.3.26.1.4-1.el7 将被 安装 --> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要 --> 正在处理依赖关系 docker-ce-rootless-extras,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要 ---> 软件包 docker-ce-cli.x86_64.1.26.1.4-1.el7 将被 安装 ---> 软件包 docker-compose-plugin.x86_64.0.2.27.1-1.el7 将被 安装 --> 正在检查事务 ---> 软件包 containerd.io.x86_64.0.1.6.33-3.1.el7 将被 安装 --> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.6.33-3.1.el7.x86_64 需要 ---> 软件包 docker-ce.x86_64.3.26.1.4-1.el7 将被 安装 --> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要 ---> 软件包 docker-ce-rootless-extras.x86_64.0.26.1.4-1.el7 将被 安装 --> 正在处理依赖关系 fuse-overlayfs >= 0.7,它被软件包 docker-ce-rootless-extras-26.1.4-1.el7.x86_64 需要 --> 正在处理依赖关系 slirp4netns >= 0.4,它被软件包 docker-ce-rootless-extras-26.1.4-1.el7.x86_64 需要 --> 解决依赖关系完成 错误:软件包:3:docker-ce-26.1.4-1.el7.x86_64 (docker-ce-stable) 需要:container-selinux >= 2:2.74 错误:软件包docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable) 需要:slirp4netns >= 0.4 错误:软件包docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable) 需要:fuse-overlayfs >= 0.7 错误:软件包:containerd.io-1.6.33-3.1.el7.x86_64 (docker-ce-stable) 需要:container-selinux >= 2:2.74 您可以尝试添加 --skip-broken 选项来解决该问题 您可以尝试执行:rpm -Va --nofiles --nodigest [root@localhost ~]# sudo systemctl restart docker Failed to restart docker.service: Unit not found. [root@localhost ~]# cat /etc/yum.repos.d/ cat: /etc/yum.repos.d/: 是一个目录 [root@localhost ~]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# ls CentOS-Base.repo.backup CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo docker-ce.repo epel.repo [root@localhost yum.repos.d]#
最新发布
09-18
### 解决yum安装docker相关组件时的依赖问题 当在使用yum安装docker相关组件时遇到依赖问题(`container-selinux >= 2:2.74`、`fuse-overlayfs >= 0.7`、`slirp4netns >= 0.4`),可以手动安装依赖包。以`container-selinux`为例,运行以下命令: ```bash wget http://mirror.nsc.liu.se/centos-store/7.6.1810/extras/x86_64/Packages/container-selinux-2.74-1.el7.noarch.rpm rpm -ivh container-selinux-2.74-1.el7.noarch.rpm ``` 对于`fuse-overlayfs``slirp4netns`,可以通过以下方式安装: ```bash yum install fuse-overlayfs slirp4netns ``` 如果默认yum源中没有合适版本,可以通过搜索合适的镜像源下载对应版本的rpm包进行安装。 ### 解决sudo systemctl restart docker提示Unit not found的问题问题通常是因为docker服务未正确安装或服务文件未配置。若使用二进制部署的docker,需确保docker服务已正确配置。首先下载docker包: ```bash wget -c https://download.docker.com/linux/static/stable/x86_64/docker-20.10.17.tgz ``` 解压docker包到`/usr/local/`目录下: ```bash tar -xvf ./docker-20.10.17.tgz -C /usr/local ``` 将docker相关程序文件拷贝到`/usr/bin`目录,做全局命令: ```bash cp /usr/local/docker/* /usr/bin/ ``` 新建`/etc/docker`目录: ```bash mkdir -p /etc/docker ``` 之后需要创建并配置`docker.service`文件,创建`/etc/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 # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock 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. # Both the old, and new name are accepted by systemd 230 and up, so using the old name to make # them work for either version of systemd. 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 OOMScoreAdjust=-500 [Install] WantedBy=multi-user.target ``` 执行以下命令使配置生效: ```bash systemctl daemon-reload ``` 最后启动docker服务并设置开机自启: ```bash systemctl start docker systemctl enable docker systemctl enable containerd ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Nobody.sir

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值