环境配置:
系统:CentOS
yum安装 :
yum 源参考:http://mirrors.163.com/.help/centos.html
1,首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2, 下载对应版本repo文件, 放入/etc/yum.repos.d/, 此处以centos7 为准
3, 运行以下命令生成缓存
yum clean all (清除缓存)
yum makecache (建立新缓存)
4, 运行以命令,卸载旧版本:
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
5,安装依赖项:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
6,添加软件源:
sudo yum-config-manager –add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fast
7,安装docker ce:
sudo yum install docker-ce
8, 查询docker ce 版本及排序:
yum list docker-ce –showduplicates | sort -r
9,启动 docker服务:
sudo systemctl start docker
10,验证安装:
sudo docker run hello-world
如有问题和技术交流,欢迎留言!