1、我直接使用安装命令安装
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
但是遇到如下报错信息
# Executing docker install script, commit: 3d8fe77c2c46c5b7571f94b42793905e5b3e42e4
+ sh -c 'yum install -y -q yum-utils'
+ sh -c 'yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo'
Adding repo from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
+ '[' stable '!=' stable ']'
+ sh -c 'yum makecache'
CentOS-8 - AppStream 947 B/s | 4.3 kB 00:04
CentOS-8 - Base 3.7 kB/s | 3.9 kB 00:01
CentOS-8 - Extras 61 B/s | 1.5 kB 00:25
Docker CE Stable - x86_64 1.2 kB/s | 9.2 kB 00:07
Metadata cache created.
+ '[' -n '' ']'
+ sh -c 'yum install -y -q docker-ce'
Error:
Problem: problem with installed package podman-1.6.4-10.module_el8.2.0+305+5e198a41.x86_64
- package podman-1.6.4-10.module_el8.2.0+305+5e198a41.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed
- package podman-2.0.5-5.module_el8.3.0+512+b3b58dca.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed
- package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-65.rc10.module_el8.2.0+305+5e198a41.x86_64
- package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-65.rc10.module_el8.2.0+305+5e198a41.x86_64
- package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
- package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
- package docker-ce-3:20.10.3-3.el8.x86_64 requires containerd.io >= 1.4.1, but none of the providers can be installed
- cannot install the best candidate for the job
- package runc-1.0.0-64.rc10.module_el8.3.0+479+69e2ae26.x86_64 is filtered out by modular filtering
这是因为CentOS 8中默认安泽了podman,与Docker冲突。
2、输入如下命令继续安装
yum install --allowerasing docker-ce
安装过程中,我们可以看到
其中,自动卸载了podman。直到出现Complete!完成安装~~~~
3、启动docker
systemctl start docker
4、查看docker状态
systemctl status docker
正在运行。
5、设置docker开机自动启动
systemctl enable docker.service
成功后,我们可以重启linux,输入reboot,启动成功后,发现docker仍是运行状态。
OK!安装成功!