官方文档:https://docs.docker.com/engine/install/centos/
- 确定是
CentOS7
及以上版本 - 卸载旧版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
yum
安装gcc
相关
yum -y install gcc
yum -y install gcc-c++
- 安装需要的软件包
yum install -y yum-utils
- 设置
stable
镜像仓库
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- 更新
yum
软件包索引
yum makecache fast
- 安装
DOCKER CE
yum -y install docker-ce docker-ce-cli containerd.io
- 启动
docker
systemctl start docker
- 测试
docker version
标签:gcc,CentOS,ce,yum,install,Docker,安装,docker,latest
From: https://www.cnblogs.com/yangyu10410/p/17896243.html