终端输入一键安装
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
可能会遇到这种错误
[root@centos8 wxf]
+ 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'
添加仓库自:https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
+ '[' stable '!=' stable ']'
+ sh -c 'yum makecache'
CentOS Linux 8 - AppStream 2.6 kB/s | 4.3 kB 00:01
CentOS Linux 8 - BaseOS 5.9 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Extras 2.3 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 8.9 kB/s | 4.3 kB 00:00
Docker CE Stable - x86_64 27 kB/s | 3.5 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 2.5 kB/s | 8.7 kB 00:03
Extra Packages for Enterprise Linux 8 - x86_64 1.0 kB/s | 7.4 kB 00:07
元数据缓存已建立。
+ '[' -n '' ']'
+ sh -c 'yum install -y -q docker-ce'
错误:
问题: problem with installed package buildah-1.19.7-1.module_el8.4.0+781+acf4c33b.x86_64
- package buildah-1.19.7-1.module_el8.4.0+781+acf4c33b.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
- package buildah-1.21.4-2.module_el8.4.0+942+d25aada8.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
- package buildah-1.21.4-1.module_el8.4.0+886+c9a8d9ad.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
- package buildah-1.19.7-2.module_el8.4.0+830+8027e1c4.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
出错执行这条指令
yum erase podman buildah
设置开机自启并启动docker
systemctl enable docker.service
systemctl start docker.service
测试
docker --version
sudo docker run hello-world
|