查看系统
[root@localhost ~]# uname -r
4.18.0-80.el8.x86_64
下载docker-ce的repo
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
更新缓存
[root@localhost ~]# dnf makecache
CentOS-8 - AppStream 783 B/s | 4.3 kB 00:05
CentOS-8 - Base 1.6 kB/s | 3.9 kB 00:02
CentOS-8 - Extras 315 B/s | 1.5 kB 00:04
Docker CE Stable - x86_64 1.4 kB/s | 3.5 kB 00:02
Extra Packages for Enterprise Linux 8 - x86_64 794 B/s | 7.1 kB 00:09
Metadata cache created.
安装docker-ce
[root@localhost ~]# dnf install docker-ce
Last metadata expiration check: 0:00:27 ago on Mon 14 Oct 2019 01:12:19 PM CST.
Error:
Problem: package docker-ce-3:19.03.3-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 excluded
- package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
- package containerd.io-1.2.2-3.el7.x86_64 is excluded
- package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
- package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
- package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
#提示缺少依赖,相比CentOS7的关键步骤
安装依赖
[root@localhost ~]# yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
安装docker-ce
dnf install docker-ce
启动docker
systemctl start docker
到此,docker仅是安装成功。