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
相关推荐
zzzzzz3102 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode2 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220702 天前
如何搭建本地yum源(上)
运维
A小辣椒3 天前
TShark:Wireshark CLI 功能
linux
A小辣椒4 天前
TShark:基础知识
linux
AlfredZhao4 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao4 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334664 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪5 天前
linux 拷贝文件或目录到指定的位置
linux
大树885 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai