下载rpm包

https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-20.10.21-3.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.6.9-3.1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-20.10.21-3.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-rootless-extras-20.10.21-3.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-compose-plugin-2.12.2-3.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-scan-plugin-0.21.0-3.el7.x86_64.rpm

在可上网的centos7.9上执行命令,下载依赖包

yum install -y --downloadonly --downloaddir=./ *.rpm

#打包整个目录 
tar -cvf docker10.20.21.tar *

将docker10.20.21.tar上传到离线的CentOS或者Redaht 7.9版本的服务器上进行安装

yum install -y *.rpm

启动和运行docker服务
systemctl enable docker.service docker.socket containerd.service
systemctl start docker.service docker.socket containerd.service

#检测安装结果 
systemctl status docker.service docker.socket containerd.service
docker version
docker info

#

参考
https://blog.csdn.net/cnskylee/article/details/127544664