CentOS 8.1安装 Docker
官方参考地址:https://docs.docker.com/install/linux/docker-ce/centos/
里面包含包下载地址:https://download.docker.com/linux/centos/8/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el8.x86_64.rpm
一。确认CentOS 版本
cat /etc/redhat-release
二。yum安装gcc相关插件
2.1 yum -y install gcc
2.2 yum -y install gcc-c++
三。安装需要的软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
四。设置stable镜像仓库
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
或
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
五。更新yum软件包索引
yum makecache fast
六。安装docker ce
yum -y install docker-ce
报错
Problem: package docker-ce-3:20.10.0-3.el7.x86_64 requires containerd.io >= 1.4.1, but none of the providers can be installed
安装centos8.1对应的 containerd.io
dnf install https://download.docker.com/linux/centos/8/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el8.x86_64.rpm
再安装docker ce
七。设置开机自启Docker并启动Docker
-
systemctl enable docker.service
-
systemctl start docker.service
八。查看docer 版本
docker version