In yum's ELRepo source, there are two kernel versions: mainline (3.13.1) and long-term (3.10.28). Considering that long-term is more stable and will be updated for a long time, this version is chosen.
[ root@localhost ~]# more /etc/issue
CentOS release 6.5(Final)
Kernel \r on an \m
[ root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 2203:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
1.> Import public key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2.> Install ELRepo into CentOS-6.5
rpm -ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
3.> Install kernel-lt (lt=long-term)
yum --enablerepo=elrepo-kernel install kernel-lt -y
Or install kernel-ml (ml=mainline)
yum --enablerepo=elrepo-kernel install kernel-ml -y
4.> Edit the grub.conf file to modify the Grub boot order
vim /etc/grub.conf
# grub.conf generated by anaconda
#
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS(3.10.28-1.el6.elrepo.x86_64)root(hd0,0)
kernel /boot/vmlinuz-3.10.28-1.el6.elrepo.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /boot/initramfs-3.10.28-1.el6.elrepo.x86_64.img
title CentOS(2.6.32-431.3.1.el6.x86_64)root(hd0,0)
kernel /boot/vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /boot/initramfs-2.6.32-431.3.1.el6.x86_64.img
Confirm where the newly installed kernel is, and then set the default value (starting from 0). Generally, the newly installed kernel is in the first position, so set default=0
5.> Restart and check the kernel version number.
[ root@localhost ~]# reboot
[ root@localhost ~]# uname -r
3.10.104- 1. el6.elrepo.x86_64
At this point, the kernel upgrade of CentOS6.5 is complete, and docker can be installed below.
Use the command directly: yum install docker-io will report an error!!! Tip: No package docker-io available.
You need to install the yum source first.
yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Execute again
yum install docker-io
You can install it normally!!
During the installation process, an error was reported due to dns problems, so you must set up your own dns to ensure that the server can connect to the external network. The dns I set at the time was:
vim /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
Start docker
service docker start
Check the docker version:
[ root@localhost ]# docker version
Client version:1.7.1
Client API version:1.19
Go version(client): go1.4.2
Git commit(client): 786b29d/1.7.1
OS/Arch(client): linux/amd64
Server version:1.7.1
Server API version:1.19
Go version(server): go1.4.2
Git commit(server): 786b29d/1.7.1
OS/Arch(server): linux/amd64
Check the docker log.
cat /var/log/docker
At this point, the docker installation is complete! ! !
Three, uninstall docker
List the packages you have installed
[ root@localhost ~]# yum list installed | grep docker
docker-io.x86_64 1.7.1-2.el6 @epel
Remove package
yum -y remove docker-io.x86_64
Delete images/containers, etc.
rm -rf /var/lib/docker
Fourth, upgrade the docker version to 1.10.3
Stop the docker service before upgrading and back up the original docker service. mv /usr/bin/docker /usr/bin/docker.bak
nohup wget -c https://get.docker.com/builds/Linux/x86_64/docker-1.10.3-O /usr/bin/docker
Give execution permission: chmod 755 /usr/bin/docker and then restart the service and check the version.
Recommended Posts