安装相关工具
yum install -y yum-utils
配置docker仓库
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
国内访问docker官方镜像可能会有异常
可以通过aliyun的源来完成
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker异常如下:
One of the configured repositories failed (Docker CE Stable - x86_64),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.