关注小众语言、AI技术,记录、分享技术点滴!

0%

Docker升级至1.9.1版本-Centos6.8

官方建议使用centos7部署docker1.9.1。
目前,很多系统仍为centos6.8,本文用于测试将centos6.8升级至1.9.1.

查看系统版本

1
2
3
$ more /etc/issue
CentOS release 6.8 (Final)
Kernel \r on an \m

查看内核版本

1
2
$ uname -r
2.6.32-573.22.1.el6.x86_64

升级内核至3.10

1
2
3
4
$ rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
$ cd /etc/yum.repos.d/
$ rpm -ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
$ yum --enablerepo=elrepo-kernel install kernel-lt -y

升级完毕,修改grup并进行重启。

修改grub.conf文件default值为0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$ vim /etc/grub.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/vda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/vda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.105-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-3.10.105-1.el6.elrepo.x86_64 ro root=UUID=55d851da-601d-440a-b119-4fcd9cde4d02 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /boot/initramfs-3.10.105-1.el6.elrepo.x86_64.img
title CentOS (2.6.32-642.6.2.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-642.6.2.el6.x86_64 ro root=UUID=55d851da-601d-440a-b119-4fcd9cde4d02 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /boot/initramfs-2.6.32-642.6.2.el6.x86_64.img

重启系统

1
$ reboot

重启后查看版本

1
2
$ uname -r
3.10.105-1.el6.elrepo.x86_64

安装docker 1.9.1

1
2
3
$ curl -sSL -O https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 && chmod +x docker-1.9.1 && mv docker-1.9.1 /usr/local/bin/docker
$ cp /usr/local/bin/docker /usr/bin/docker
$ service docker start

重启后验证

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: linux/amd64

Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: linux/amd64