Install docker to Redhat 7

1)   sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

2) sudo yum install docker-ce docker-ce-cli containerd.io

3)   上面2)应该会出错,告诉你container-selinux的版本不够

4) 

Installing the Selinux from the Centos repository worked for me: 
1. Go to http://mirror.centos.org/centos/7/extras/x86_64/Packages/ 
2. Find the latest version for container-selinux i.e. container-selinux-2.21-1.el7.noarch.rpm 
3. Run the following command on your terminal: $ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/**Add_current_container-selinux_package_here** 
4. The command should looks like the following $ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.21-1.el7.noarch.rpm 

参考:

https://docs.docker.com/install/linux/docker-ce/centos/

https://stackoverflow.com/questions/45272827/docker-ce-on-rhel-requires-container-selinux-2-9/45287245

猜你喜欢

转载自www.cnblogs.com/johnsonshu/p/11435218.html