Centos7安装docker运行命令
yum install docker-ce docker-ce-cli contrainer.io
显示container-selinux >= 2:2.74,fuse-overlayfs >= 0.7,slirp4netns >= 0.4
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* epel: d2lzkl7pfhq30w.cloudfront.net
No package contrainer.io available.
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:26.1.4-1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-26.1.4-1.el7.x86_64
--> Processing Dependency: containerd.io >= 1.6.24 for package: 3:docker-ce-26.1.4-1.el7.x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-26.1.4-1.el7.x86_64
---> Package docker-ce-cli.x86_64 1:26.1.4-1.el7 will be installed
--> Processing Dependency: docker-buildx-plugin for package: 1:docker-ce-cli-26.1.4-1.el7.x86_64
--> Processing Dependency: docker-compose-plugin for package: 1:docker-ce-cli-26.1.4-1.el7.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.6.33-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.6.33-3.1.el7.x86_64
---> Package docker-buildx-plugin.x86_64 0:0.14.1-1.el7 will be installed
---> Package docker-ce.x86_64 3:26.1.4-1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-26.1.4-1.el7.x86_64
---> Package docker-ce-rootless-extras.x86_64 0:26.1.4-1.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64
--> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64
---> Package docker-compose-plugin.x86_64 0:2.27.1-1.el7 will be installed
--> Finished Dependency Resolution
Error: Package: containerd.io-1.6.33-3.1.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
Requires: slirp4netns >= 0.4
Error: Package: 3:docker-ce-26.1.4-1.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
Requires: fuse-overlayfs >= 0.7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
需要手动安装依赖包,运行以下命令
wget http://mirror.nsc.liu.se/centos-store/7.6.1810/extras/x86_64/Packages/container-selinux-2.74-1.el7.noarch.rpm
rpm -ivh container-selinux-2.74-1.el7.noarch.rpm
如果container-selinux包有冲突需要卸载之前的包
yum remove docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch
再依次安装
yum install ftp://ftp.icm.edu.pl/vol/rzm7/linux-centos-vault/7.9.2009/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
yum install ftp://ftp.icm.edu.pl/vol/rzm7/linux-centos-vault/7.9.2009/extras/x86_64/Packages/slirp4netns-0.4.3-4.el7_8.x86_64.rpm
再次运行
yum install -y docker-ce docker-ce-cli containerd.io
就不会报错啦
启动docker systemctl start docker