# 查看内核版本,需要3.10以上
uname -r
# 更新 yum 软件包索引
yum makecache fast
# 卸载旧版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
# 安装工具包
yum install -y yum-utils
# 设置镜像厂库
yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 安装 docker Engine-Community
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
# 启动 docker
systemctl start docker
# 判断是否安装成功
docker version
# 测试
docker run hello-world
# 查看 hello-world
docker images
# 卸载 docker 依赖
yum remove docker-ce docker-ce-cli containerd.io docker-compose-plugin
# 删除资源
rm -rf /var/lib/docker
标签:ce,CentOS7,yum,world,docker,安装,latest
From: https://www.cnblogs.com/liuzonglin/p/16746692.html