yum makecache fast; yum update;
下面安装docker 可以参考 官方文档:https://docs.docker.com/engine/installation/linux/centos/#install-using-the-repository
如果有安装老版本 请先
sudo yum remove docker \
docker-common \
container-selinux \
docker-selinux \
docker-engine
删除老版本
注意 备份或者迁移 默认在 /var/lib/docker/下的镜像等内容
安装docker需要的虚拟文件系统所需东东
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
安装docker的源
yum -y install yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
屏蔽系统源
sudo yum-config-manager --disable docker-ce-edge
安装docker社区版本
sudo yum install docker-ce
开机启动
systemctl
enable
docker.service
systemctl start
docker.service
这就行了 基础的centos7。x的docker ce版本安装好了
我没有换源 如果要换
参考我下面摘录的(摘自:http://blog.csdn.net/lcj200813138020/article/details/46914161):
1. 切换到系统yum源的目录下,即:cd/etc/yum.repos.d
wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo
279 yum remove docker-ce
280 yum cleanall
281 yum clean all
282 rm -rf /var/cache/yum
283*
284 rm -rf /etc/docker
285 rm -rf /var/lib/docker
286 find / -name docker
287 cat /etc/selinux/targeted/active/modules/disabled/docker
288 cd /etc/selinux/targeted/active/modules/disabled/docker
289 rm /etc/selinux/targeted/active/modules/disabled/docker
290 find / -name docker*
291 rm -rf /etc/systemd/system/docker.service.d
292 find / -name docker*
293 ls /usr/lib/firewalld/services/
294 cat /usr/lib/firewalld/services/docker-registry.xml
295 ls /etc/selinux/targeted/modules/active/modules/
296 cat docker.pp
297 cd /etc/selinux/targeted/modules/active/modules/
298 ls
299 cat docker.pp
300 PuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY6cPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY
301 cat docker.pp
302 PuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY6cPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY
303 ls
304 yum install docker-ce
305 systemctl start docker.service
306 systemctl enable docker.service
其实主要就是删掉一些docker开头的文件和目录就i行了