参考官网 https://docs.docker.com/install/linux/
发现docker 分为 CE 和EE 两个版本 就是个人和小型企业测试版 以及大企业稳定版 (貌似是要收费)
所以这里下的都是CE版。
安装分为三种渠道。这里选择的是第一种 也是选择人数最多的一种。
首先。Uninstall old versions 也就是卸载旧版本 yum remove docker-io 等相关操作。操作完成 卸载成功。
然后安装新版本
Before you install Docker CE for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
在安装CE版本以前,需要安装一个docker仓库,然后就可以从仓库里安装或者更新docker的相关操作了。
Install required packages. yum-utils
provides the yum-config-manager
utility, and device-mapper-persistent-data
and lvm2
are required by the devicemapper
storage driver.
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well.
使用下面的命令 设置稳定仓库
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
下面的命令就是仓库的一些开关操作了。执行就好
$ sudo yum-config-manager --enable docker-ce-edge
$ sudo yum-config-manager --enable docker-ce-test
$ sudo yum-config-manager --disable docker-ce-edge
到这里仓库就安装完成了。开始安装docker
sudo yum install docker-ce
这里只适合CentOs7 如果是6 只能先升级到7 才能把yum源升级到centOs7 才不会报错
因为我是centOs6 还不能升级到7 安装12版本以上各种报错。。
我只好回去安装 1.7.1 版本了。。
到这里12版本就安装完了。。