CentOS6.5安装docker

Posted wshenjin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS6.5安装docker相关的知识,希望对你有一定的参考价值。

先用CentOS6.5安装docker-io学习着,什么历史、优势、特点先不扯了。

升级内核

yum安装带aufs模块的3.10内核

[[email protected]_192.168.31.129 ~]# cd /etc/yum.repos.d 
[[email protected]_192.168.31.129 ~]# wget http://www.hop5.in/yum/el6/hop5.repo
[[email protected]_192.168.31.129 ~]# yum clean all
[[email protected]_192.168.31.129 ~]# yum install -y kernel-ml-aufs kernel-ml-aufs-devel

修改grub:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda2
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.5-3.el6.x86_64)
    root (hd0,0)
    kernel /vmlinuz-3.10.5-3.el6.x86_64 ro root=UUID=c29afc67-d24a-412c-8d22-9048ada1f057 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD
SYSFONT=latarcyrheb-sun16 rd_NO_LVM crashkernel=auto rhgb quiet rd_NO_DM rhgb quiet
    initrd /initramfs-3.10.5-3.el6.x86_64.img
title MyCentOS_mini-base (2.6.32-431.el6.x86_64)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=c29afc67-d24a-412c-8d22-9048ada1f057 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_M
D SYSFONT=latarcyrheb-sun16 rd_NO_LVM crashkernel=auto rhgb quiet rd_NO_DM rhgb quiet
    initrd /initramfs-2.6.32-431.el6.x86_64.img

重启

查看内核:

[[email protected]_192.168.31.129 ~]# uname -r
3.10.5-3.el6.x86_64

安装docker

epel源:

rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
sed -i ‘s/^mirrorlist=https/mirrorlist=http/‘ /etc/yum.repos.d/epel.repo

安装docker:

yum install -y docker-io

启动:

[[email protected]_192.168.31.129 ~]# mv /var/lib/docker /data/
[[email protected]_192.168.31.129 ~]# ln -sv /data/docker /varlib/docker
`/data/docker‘ -> `/varlib/docker‘
[[email protected]_192.168.31.129 ~]# /etc/init.d/docker start 
Starting docker:                                           [  OK  ]

瞄一眼:

[[email protected]_192.168.31.129 ~]# 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

以上是关于CentOS6.5安装docker的主要内容,如果未能解决你的问题,请参考以下文章

centos6.5 安装docker方法

CentOS6.5 安装docker

CentOS6.5安装Docker

centos6.5安装docker

CentOS6.5安装docker环境

CentOS6.5安装docker