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
相关推荐
企鹅的蚂蚁17 分钟前
LubanCat RK3588 实时 Linux 开发(六):启用 gs_usb 驱动并完成 USB-CAN 收发
linux·rk3588·linux驱动·socketcan·gs_usb·usb-can
2601_9622998828 分钟前
Linux执行Python脚本方法
linux·python·脚本·解释器·shebang
snow@li36 分钟前
服务器运维:Linux命令速查手册(全景梳理)
linux·服务器·网络
handler0136 分钟前
【Linux】线程与虚拟内存的底层世界
linux·运维·服务器·c++·线程·虚拟地址空间·共享内存
布莱克60543 分钟前
TCP 三次握手与四次挥手详解
服务器·网络·tcp/ip·计算机网络·网络编程
新时代牛马1 小时前
实时 Linux:PREEMPT_RT、延迟来源与观测
linux·运维·服务器
微露清风1 小时前
# Linux 进程全景:从 PCB 到 O(1) 调度队列
linux·服务器
H_oRIZoN_1 小时前
Linux入门DAY38(手写 HTTP 客户端抓取天气 + 简易 HTTP 服务器实现元器件 Web 系统)
linux·linux应用编程
zhexunnb2 小时前
深挖SAP系统模块价值,助力无锡制造企业打通数字化全链路
运维
fangjianj2 小时前
windows环境反弹shell
linux·windows·web安全