1. 安装工具yum install -y yum-utils2. 添加阿里Docker源yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo3. 更新缓存很重要yum makecache fast4. 安装Dockeryum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin5. 启动Dockersystemctl start docker6. 设置开机启动systemctl enable docker7. 验证docker -v安装完你要做的✔ 测试Docker是否正常需要配置下面的daemon.jsondocker run hello-world 如果看到Hello from Docker!✔ 成功⸻国内必须做的优化不然你会卡死配置镜像加速非常重要mkdir -p /etc/dockervim /etc/docker/daemon.json写入{registry-mirrors: [https://docker.m.daocloud.io,https://hub-mirror.c.163.com,https://mirror.baidubce.com]}然后systemctl daemon-reexecsystemctl restart docker