卸载旧版本
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
安装GCC
yum -y install gcc
yum -y install gcc-c++
安装软件包
yum install -y yum-utils
设置镜像仓库
官方设置
yum-config-manager --add-repo https://download.docker.com/linux/centos/dockerce.repo
阿里云
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新yum索引
yum makecache fast
安装
yum -y install docker-ce docker-ce-cli containerd.io
启动
systemctl start docker
设置自启动
systemctl enable docker
信息查看
docker version
测试
docker run hello-world
标签:基础,ce,repo,yum,install,Docker,安装,docker,latest
From: https://www.cnblogs.com/tshuai/p/17682099.html