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
相关推荐
xihaowen10 分钟前
Ubuntu磁盘映射到本地磁盘
android·java·运维·服务器·windows·ubuntu
fmk102313 分钟前
安装并配置Nginx
linux·运维·nginx
zhu_superman27 分钟前
在程序被 kill 后立即重启时“bind socket失败“ 的问题
服务器·网络·tcp/ip
懂电商API接口的Jennifer28 分钟前
电商数据自动化批量采集:商品数据|订单数据|店铺数据|图片搜索|关键字搜索
java·运维·爬虫·自动化·网络爬虫
蛙潮31 分钟前
Ubuntu20.04离线安装dpkg
linux·运维·服务器
YRr YRr1 小时前
ubuntu bin目录
linux·运维·ubuntu
代码要你命1 小时前
Linux免交互
linux·交互
thank861 小时前
Linux 在文件内读取时间段字符串并解析判断当前时间是否在时间段内 C语言
linux·c语言
gopher95111 小时前
shell脚本if/else使用示例
linux·运维·服务器
王小磊学代码1 小时前
Linux---- 防火墙
linux·服务器