Redhat7.9上安装Docker
一、linux环境说明
Red Hat Enterprise Linux 7.9 下载后(见参考1),vmware安装虚拟机
[root@localhost /]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
[root@localhost /]# cat /proc/version
Linux version 3.10.0-1160.el7.x86_64 (mockbuild@x86-vm-26.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Aug 18 14:50:17 EDT 2020
二、离线安装docker
step1:Uninstall old versions 卸载老版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
step2:离线安装docker相关组件
如果在线安装latest版本命令为:yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
前往网址https://download.docker.com/linux/centos/7/x86_64/stable/Packages/下载相应的rpm包,并将相关rpm包放置在指定文件夹下,如/opt/findig/PYTHON/docker-rpm/
cd /opt/findig/PYTHON/docker-rpm/
yum install docker-ce-rootless-extras-23.0.3-1.el7.x86_64.rpm docker-ce-23.0.3-1.el7.x86_64.rpm docker-ce-cli-23.0.3-1.el7.x86_64.rpm containerd.io-1.6.9-3.1.el7.x86_64.rpm docker-buildx-plugin-0.10.4-1.el7.x86_64.rpm docker-compose-plugin-2.6.0-3.el7.x86_64.rpm
#docker-ce-rootless-extras-23.0.3-1.el7.x86_64.rpm 是由于安装报错Error: Package: 3:docker-ce-23.0.3-1.el7.x86_64 (/docker-ce-23.0.3-1.el7.x86_64),Requires: docker-ce-rootless-extras
#安装时显示需要依赖其他的yum包,但是内网是非在线环境,不定能yum这些包,因此这个问题后续需要继续留意。on todo list
yum install docker-ce-rootless-extras-23.0.3-1.el7.x86_64.rpm docker-ce-23.0.3-1.el7.x86_64.rpm docker-ce-cli-23.0.3-1.el7.x86_64.rpm containerd.io-1.6.9-3.1.el7.x86_64.rpm docker-buildx-plugin-0.10.4-1.el7.x86_64.rpm docker-compose-plugin-2.6.0-3.el7.x86_64.rpm
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Examining docker-ce-rootless-extras-23.0.3-1.el7.x86_64.rpm: docker-ce-rootless-extras-23.0.3-1.el7.x86_64
Marking docker-ce-rootless-extras-23.0.3-1.el7.x86_64.rpm to be installed
Examining docker-ce-23.0.3-1.el7.x86_64.rpm: 3:docker-ce-23.0.3-1.el7.x86_64
Marking docker-ce-23.0.3-1.el7.x86_64.rpm to be installed
Examining docker-ce-cli-23.0.3-1.el7.x86_64.rpm: 1:docker-ce-cli-23.0.3-1.el7.x86_64
Marking docker-ce-cli-23.0.3-1.el7.x86_64.rpm to be installed
Examining containerd.io-1.6.9-3.1.el7.x86_64.rpm: containerd.io-1.6.9-3.1.el7.x86_64
Marking containerd.io-1.6.9-3.1.el7.x86_64.rpm to be installed
Examining docker-buildx-plugin-0.10.4-1.el7.x86_64.rpm: docker-buildx-plugin-0.10.4-1.el7.x86_64
Marking docker-buildx-plugin-0.10.4-1.el7.x86_64.rpm to be installed
Examining docker-compose-plugin-2.6.0-3.el7.x86_64.rpm: docker-compose-plugin-2.6.0-3.el7.x86_64
Marking docker-compose-plugin-2.6.0-3.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.6.9-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.6.9-3.1.el7.x86_64
Loading mirror speeds from cached hostfile
* elrepo: mirrors.tuna.tsinghua.edu.cn
---> Package docker-buildx-plugin.x86_64 0:0.10.4-1.el7 will be installed
---> Package docker-ce.x86_64 3:23.0.3-1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:23.0.3-1.el7 will be in