Centos 6 安装Docker

使用的操作系统是是centos6,按照官方的推荐的配置,把linux内核升级到3.8以上。安装步骤如下:

1、当前版本:

[root@localhost ~]# more /etc/issue
CentOS release 6.9 (Final)
Kernel 
 on an m

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-696.6.3.el6.x86_64 #1 SMP Wed Jul 12 14:17:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

2、导入public key :

[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

3、安装ELRepe 到 Centos ,

  在http://elrepo.org/tiki/tiki-index.php 选择要安装的ELRepo ,如下 Get Started:

To install ELRepo for RHEL-6, SL-6 or CentOS-6:
rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

 运行

[root@localhost ~]#rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

4、 安装 kernel-ml (mainline)

[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-ml -y

5、修改引导的内核

vi /etc/grub.conf
把默认的引导文件设置为0。因为升级内核之后,新的内核在第一个 0 位置。

6、重启系统,使用新的内核
#检查内核版本:
uname -r
3.10.107-1.el6.elrepo.x86_64

7、检测aufs (如果 aufs 没有安装成功,详见我的另一篇博客)

[root@localhost ~]# grep aufs /proc/filesystems 
nodev   aufs

至此就可以安装docker运行环境了。 

注:
1、Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。 2、Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本
原文地址:https://www.cnblogs.com/logo-fox/p/7365718.html