centos7或者rh7以上安装docker提示Requires: container-selinux >= 2.9
解决办法:
https://pkgs.org/download/container-selinux
下载container-selinux2.9.4
然后 执行 rpm -ivh container-selinux-2.9-4-1.el7.noarch.rpm
接着执行 yum -y install docker-ce
安装成功!
如果需要自定义版本安装
在正式环境,必须使用统一的稳定版本,而不是总使用最新(这样各host上的版本可能不一致)。下面这个例子是使用sort -r 命令来排序docker-ce的版本,从高到低。
yum list docker-ce --showduplicates | sort -r
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.0.ce-1.el7.centos @docker-ce-stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable
yum install docker-ce-17.09.0.ce