Rocky Linux安装Docker

简介:

Red Hat Enterprise Linux (RHEL):

RHEL 是由 Red Hat 公司开发和维护的企业级操作系统。

它是基于开源社区的 Fedora 项目,但提供了商业支持和服务,面向企业用户。

RHEL 提供了稳定、可靠和高性能的操作环境,广泛用于企业服务器和工作站。

Rocky Linux:

Rocky Linux 是一个社区驱动的开源项目,旨在作为 RHEL 的免费替代品。

它是由 CentOS 项目联合创始人之一 Gregory Kurtzer 发起的。CentOS 曾经是 RHEL 的免费替代品,但随着 CentOS 项目转向 CentOS Stream,Rocky Linux 诞生了,以填补 CentOS 留下的空白。

Rocky Linux 与 RHEL 具有二进制兼容性,即 Rocky Linux 使用与 RHEL 相同的源代码进行构建,因此软件和系统行为应该与 RHEL 一致。

1.卸载 Podman

使用 dnf(适用于 RHEL 8+/CentOS 8+/Rocky Linux)或 yum(适用于 RHEL 7/CentOS 7):

bash 复制代码
sudo dnf remove podman # 或者 sudo yum remove podman

2.删除podman残留文件

bash 复制代码
sudo rm -rf /etc/containers /etc/registries.conf /etc/containers/policy.json /etc/containers/storage.conf ~/.config/containers ~/.local/share/containers

3.卸载旧版docker

bash 复制代码
sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

4.编写docker软件源仓库

diff 复制代码
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-stable-debuginfo]
name=Docker CE Stable - Debuginfo $basearch
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/debug-$basearch/stable
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/source/stable
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-test]
name=Docker CE Test - $basearch
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-test-debuginfo]
name=Docker CE Test - Debuginfo $basearch
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/debug-$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-test-source]
name=Docker CE Test - Sources
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/source/test
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-nightly]
name=Docker CE Nightly - $basearch
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-nightly-debuginfo]
name=Docker CE Nightly - Debuginfo $basearch
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/debug-$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

[docker-ce-nightly-source]
name=Docker CE Nightly - Sources
baseurl=https://mirror.nju.edu.cn/docker-ce/linux/rhel/$releasever/source/nightly
enabled=0
gpgcheck=1
gpgkey=https://mirror.nju.edu.cn/docker-ce/linux/rhel/gpg

5.安装docker

bash 复制代码
sudo dnf install -y docker-ce docker-ce-cli containerd.io
相关推荐
chlk12318 小时前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑19 小时前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件19 小时前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒20 小时前
OpenClaw 多 Agent 配置实战指南
运维
深紫色的三北六号1 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash1 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI2 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行2 天前
Linux和window共享文件夹
linux
Sinclair3 天前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
木心月转码ing3 天前
WSL+Cpp开发环境配置
linux