1.配置docker镜像安装源
tee /etc/yum.repos.d/docker.repo <<-'EOF'[dockerrepo]name=Docker Repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/7/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpgEOF
4.安装docker
yum install docker-engine
5.启动docker
systemctl enable docker.servicesystemctl start docker
卸载
1.查询安装过的包
yum list installed | grep dockerdocker-engine.x86_64 17.03.0.ce-1.el7.centos @dockerrepo
2.删除安装的软件包
yum -y remove docker-engine.x86_64
3.删除镜像/容器等
rm -rf /var/lib/docker
参见:https://docs.docker.com/engine/installation/linux/centos/
感谢:http://www.cnblogs.com/xuezhigu/p/6553936.html 同学的知识分享。