CentOS6.5安装docker

个人学习笔记,谢绝转载!!!
原文:https://www.cnblogs.com/wshenjin/p/9319923.html


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

升级内核

yum安装带aufs模块的3.10内核

[root@docker-machine_192.168.31.129 ~]# cd /etc/yum.repos.d 
[root@docker-machine_192.168.31.129 ~]# wget http://www.hop5.in/yum/el6/hop5.repo
[root@docker-machine_192.168.31.129 ~]# yum clean all
[root@docker-machine_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

重启

查看内核:

[root@docker-machine_192.168.31.129 ~]# uname -r
3.10.5-3.el6.x86_64

安装docker

epel源:

yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

安装docker:

yum install -y docker-io

修改docker root:

[root@docker-machine_192.168.31.129 ~]# mv /var/lib/docker /data/
[root@docker-machine_192.168.31.129 ~]# ln -sv /data/docker /varlib/docker
`/data/docker' -> `/varlib/docker'
#或者:
[root@docker-machine_192.168.31.129 ~]# cat /etc/docker/daemon.json 
{
  "data-root" : "/data/dokcer",
}
启动:
[root@docker-machine_192.168.31.129 ~]# /etc/init.d/docker start 
Starting docker:                                           [  OK  ]

瞄一眼:

[root@docker-machine_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
posted @ 2018-07-16 20:26  wshenJin  阅读(179)  评论(0编辑  收藏  举报