一聚教程网:一个值得你收藏的教程网站

热门教程

centos6.4安装docker教程

时间:2022-06-30 21:07:35 编辑:袖梨 来源:一聚教程网

一、升级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

二、安装Docker

$ wget https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm
$ sudo yum install -y libcgroup.x86_64 glibc.i686 sqlite.i68
$ sudo rpm -ivh docker-engine-1.7.0-1.el6.x86_64.rpm

三、配置

$ 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

热门栏目