centos6.8默认的内核版本为2.6 而docker安装要求为系统64位 内核版本3以上 所以需要对内核版本进行更新
vi /etc/selinux/config
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-lt -y
vi /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
[root@blogforum ~]# uname -a
Linux blogforum 3.10.107-1.el6.elrepo.x86_64 #1 SMP Tue Jun 27 10:57:54 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
yum install docker-io
[root@blogforum ~]# /etc/init.d/docker start
Starting cgconfig service: [ OK ]
Starting docker: [ OK ]
[root@blogforum ~]# chkconfig --level 0123456 docker on
[root@blogforum ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
[root@blogforum ~]# docker pull centos
latest: Pulling from centos
d9cdac769794: Downloading [> ] 278.5 kB/72.25 MB
8b7794bcb4f9: Download complete
f3b88ddaed16: Download complete
Pulling repository centos
Repository not found
[root@blogforum yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@blogforum yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
[root@blogforum yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* elrepo: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.7 kB 00:00
base/group_gz | 226 kB 00:00
base/filelists_db | 6.4 MB 00:06
[root@blogforum yum.repos.d]# docker pull centos
latest: Pulling from centos
d9cdac769794: Pull complete
8b7794bcb4f9: Pull complete
f3b88ddaed16: Pull complete
Digest: sha256:acb3b91e930743331be14cd3c8154da9967e2a2fca2aad0e1f27efce6deb2884
Status: Downloaded newer image for centos:latest
[root@blogforum yum.repos.d]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos latest f3b88ddaed16 13 days ago 192.5 MB
[root@blogforum yum.repos.d]#