CentOS-6.5在线安装Docker-1.7教程(升级内核)

前一篇博客讲到了Centos6.5在线安装docker1.7的方式。由于docker官方推荐的内核版本是3.10以上,本文在上一篇基础上增加了升级内核的方法,然后再3.10内核基础上安装docker。

1.  安装EPEL

For CentOS-6.5, theDocker package is part of Extra Packages for EnterpriseLinux (EPEL) repository, a community effort to create and maintain additionalpackages for the RHEL distribution. Firstly, you need to ensure you have theEPEL repository enabled. Please follow theEPEL installation instructions.

1.1 安装yum优先级插件

# yum install yum-priorities

1.2 安装epel

# rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

1.3 查看是否安装成功

# rpm -q epel-release

1.4 导入key:

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

1.5 修改/etc/yum.repos.d/epel.repo文件,在[epel]最后添加一条属性 priority=11

# vi /etc/yum.repos.d/epel.repo

1.6  重建缓存

# yum makecache

安装完成之后,确保yum list能找到Docker的相关rpm包。

 

2.  升级内核

2.1  导入public key

# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

2.2  安装ELRepo到CentOS-6.5中

# rpm -ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm

这里可能会找不到,需改为

rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm

2.3  安装kernel-lt(lt=long-term)这个比较稳定,会持续更新,二选一。

# yum --enablerepo=elrepo-kernel install kernel-lt -y

可以装kernel-ml(ml=mainline)

# yum --enablerepo=elrepo-kernel install kernel-ml -y

2.4  修改Grub引导顺序

# vi  /etc/grub.conf设置default=0

2.5  重启

2.6  uname -a检查

3.   安装docker

For CentOS-6, thereis a package name conflict with a system tray application and its executable,so the dockerRPM package was calleddocker-io.To proceed with docker-io installation on CentOS-6, you may need toremove thedocker package first. Next,let's install the docker-io package which willinstall Docker on our host.

3.1 remove docker

# yum remove docker

 

3.2 安装docker

# yum install docker-io

4.    更新device-mapper-libs

# yum upgrade device-mapper-libs

5.    设置开机自启

# chkconfig docker on

6.    检查支持情况

# lxc-checkconfig

7.    启动cgroup

# service cgconfig start

8.  启动docker

# docker –d &

9.    测试

# docker ps -a

转载于:https://my.oschina.net/xunzhizhe/blog/1476581

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值