一、升级kernel
因为CentOS6.4自带内核版本是2.6.32-358.23.2.el6.x86_64,而Docker要求内核版本大于3.0,推荐3.8以上的内核:
$ wget http://elrepo.org/linux/kernel/el6/x86_64/RPMS/kernel-lt-3.10.84-1.el6.elrepo.x86_64.rpm$ sudo rpm -ivh kernel-lt-3.10.84-1.el6.elrepo.x86_64.rpm$ sudo vim /boot/grub/grub.confdefault=0 #修改默认启动项为新内核$ sudo reboot
二、安装Docker
$ curl -sSL https://get.docker.com/ | sudo sh$ sudo yum install -y device-mapper-libs
三、配置
$ sudo vim /etc/sysconfig/docker other_args="$other_args --registry-mirror=http://556b149e.m.daocloud.io" other_args="$other_args --log-driver=none"
四、启动
$ sudo service docker start
如果出现如下问题:
docker: relocation error: docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
解决办法:
$ sudo cd /etc/yum.repos.d$ sudo wget public-yum.oracle.com/public-yum-ol6.repo$ sudo wget public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle $ sudo yum update -y device-mapper-libs$ sudo yum update -y libcgroup