1. 配置阿里云的镜像源 (centos8)
cd /etc/yum.repos.dmkdir repo_backupmv *.repo repo_backupwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repoyum clean allyum makecache
2. 设置docker-ce源仓库
# step 1: 安装yum-utils包(提供yum-config-manager工具)sudo yum install -y yum-utils# Step 2: 添加软件源仓库sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo# Step 3: 更新软件源并安装 Docker-CEsudo yum makecachesudo yum -y install docker-ce# Step 4: 开启Docker服务sudo systemctl start docker# 检验安装查看docker版本信息docker version
3. 运行 hello-world
sudo docker run hello-world
```
