安装gcc
yum -y install gcc
yum -y install gcc-c++
卸载旧版(没有可忽略)
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine \
docker-ce
安装软件包
yum install -y yum-utils
设置镜像仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新软件包索引
yum makecache fast
安装docker
yum -y install docker-ce docker-ce-cli containerd.io
启动docker
systemctl start docker
加入开机启动
systemctl enable docker