首先,确定版本,本文选用centos7版本:(为了保证docker的正确部署,建议大家选择centos6.5及以上版本)
安装
本文版本:
[root@www ~]# uname -a
Linux www.linuxprobe.com 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
1:删除已安装的docker或者旧版本的docker
[root@www ~]# yum remove docker
已加载插件:fastestmirror, langpacks
参数 docker 没有匹配
不删除任何软件包
小博主使用的是没有docker的linux服务器
2:安装docker相关软件
[root@www ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
...
更新完毕:
device-mapper-persistent-data.x86_64 0:0.7.3-3.el7 lvm2.x86_64 7:2.02.177-4.el7
作为依赖被升级:
device-mapper.x86_64 7:1.02.146-4.el7
device-mapper-event.x86_64 7:1.02.146-4.el7
device-mapper-event-libs.x86_64 7:1.02.146-4.el7
device-mapper-libs.x86_64 7:1.02.146-4.el7
lvm2-libs.x86_64 7:2.02.177-4.el7
完毕!
[root@www ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
已加载插件:fastestmirror, langpacks
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
更新yum并安装docker-ce
[root@www ~]# yum makecache fast
已加载插件:fastestmirror, langpacks
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
epel/x86_64/metalink | 8.9 kB 00:00:00
extras | 3.4 kB 00:00:00
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql57-community | 2.5 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/2): docker-ce-stable/x86_64/primary_db | 19 kB 00:00:00
(2/2): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00
Loading mirror speeds from cached