Docker 从 1.13 版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE。
Docker社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比如经过官方测试认证过的基础设施、容器、插件等。
Docker社区版按照 stable 和 edge 两种方式发布,每个季度更新 stable 版本,如17.06,17.09;每个月份更新 edge 版本,如17.09,17.10。
[root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.0.1406 (Core)
使用 cat /etc/redhat-release 命令,查看当前 Linux 的发行版本。
[root@localhost ~]# uname -r 3.10.0-123.el7.x86_64
Docker 安装要求 CentOS 系统的内核版本高于 3.10,通过 uname -r 命令查看当前的内核版本。
[root@localhost ~]# yum update
使用 root 权限登录 Centos。确保 yum 包更新到最新。
[root@localhost ~]# yum remove docker docker-common docker-selinux docker-engine 已加载插件:fastestmirror, langpacks 参数 docker 没有匹配 参数 docker-common 没有匹配 参数 docker-selinux 没有匹配 参数 docker-engine 没有匹配 不删除任何软件包
如果安装过旧版本,使用 yum remove 卸载旧版本。
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
安装需要的软件包, yum-util 提供 yum-config-manager 功能,另外两个是 devicemapper 驱动依赖的。
安装成功,如下图所示:
[root@localhost ~]# yum-config-manager --add-repo
设置 Docker yum 源,设置成功,如下图所示:
[root@localhost ~]# yum list docker-ce --showduplicates | sort -r
使用 yum list 查看所有可安装的 Docker 版本,如下图所示:
[root@localhost ~]# yum install docker-ce
由于 Docker repo 中默认只开启 stable 仓库,故这里安装的是最新稳定版。安装成功,如下图:
[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl status docker
Docker 启动成功,界面如下:
[root@localhost ~]# systemctl enable docker
加入成功,界面如下:
[root@localhost ~]# systemctl list-unit-files | grep docker
加入启动项后,界面如下: