测试的时候,在VM中安装了一个minimal安装的centos7.
因为发现在已经安装好环境的系统中,执行下面,并不会下载依赖的rpm.
#下载docker-ce和其需要的依赖rpm
yum install docker-ce --downloadonly --downloaddir=/home/student/docker-local
#发现这个包已经存,所以只用更新就可以
rpm -U audit-libs-2.8.-.el7_5..x86_64.rpm
#案装其他包与docker-ce 可按下面的顺序安装 或者使用 rpm -ivh --nodeeps来忽略警告
rpm -ivh audit-2.8.-.el7_5..x86_64.rpm
rpm -ivh audit-libs-python-2.8.-.el7_5..x86_64.rpm
rpm -ivh checkpolicy-2.5-.el7.x86_64.rpm
rpm -ivh libcgroup-0.41-.el7.x86_64.rpm
rpm -ivh libsemanage-python-2.5-.el7.x86_64.rpm
rpm -ivh python-IPy-0.75-.el7.noarch.rpm
rpm -ivh setools-libs-3.3.-.el7.x86_64.rpm
rpm -ivh policycoreutils-python-2.5-.el7.x86_64.rpm
rpm -ivh container-selinux-2.68-.el7.noarch.rpm
rpm -ivh docker-ce-18.06..ce-.el7.x86_64.rpm
#反向操作
rpm -e --nodeps audit-2.8.-.el7_5..x86_64
rpm -e --nodeps audit-libs-python-2.8.-.el7_5..x86_64
rpm -e --nodeps checkpolicy-2.5-.el7.x86_64
rpm -e --nodeps libcgroup-0.41-.el7.x86_64
rpm -e --nodeps libsemanage-python-2.5-.el7.x86_64
rpm -e --nodeps python-IPy-0.75-.el7.noarch
rpm -e --nodeps setools-libs-3.3.-.el7.x86_64
rpm -e --nodeps policycoreutils-python-2.5-.el7.x86_64
rpm -e --nodeps container-selinux-2.68-.el7.noarch
rpm -e --nodeps docker-ce-18.06..ce-.el7.x86_64
#启动docker-ce
systemctl start docker
#检查docker 版本
docker version