一般安裝 Docker 為以下指令
$ sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
$ sudo dnf install docker-ce
但可能會出現以下結果
Last metadata expiration check: 0:03:29 ago on Fri 17 Jul 2020 10:27:21 PM CST.
Error:
Problem: package docker-ce-3:19.03.12-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
- cannot install the best candidate for the job
- package containerd.io-1.2.10-3.2.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.13-3.1.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.13-3.2.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.2-3.3.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.2-3.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.4-3.1.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.5-3.1.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.6-3.3.el7.x86_64 is filtered out by modular filtering
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
雖然內建有提供 containerd.io 但版本比較舊,可以直接到這:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ 找最新版本
$ sudo dnf install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm
再安裝 Docker 就妥當了
$ sudo dnf install -y docker-ce
Last metadata expiration check: 0:02:28 ago on Fri 17 Jul 2020 11:07:07 PM CST.
Dependencies resolved.
==========================================================================================================================================================================================================================================
Package Architecture Version Repository Size
==========================================================================================================================================================================================================================================
Installing:
docker-ce x86_64 3:19.03.12-3.el7 docker-ce-stable 24 M
Installing dependencies:
docker-ce-cli x86_64 1:19.03.12-3.el7 docker-ce-stable 38 M
libcgroup x86_64 0.41-19.el8 BaseOS 70 k
tar x86_64 2:1.30-4.el8 BaseOS 838 k
Transaction Summary
==========================================================================================================================================================================================================================================
Install 4 Packages
Total download size: 63 M
Installed size: 266 M