CentOS6.5安裝docker

先用CentOS6.5安裝docker-io學習着,什麼歷史、優點、特色先不扯了。linux

升級內核

yum安裝帶aufs模塊的3.10內核docker

[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:shell

# 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

重啓json

查看內核:學習

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

安裝docker

epel源:ui

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

安裝docker:this

yum install -y docker-io

修改docker root:code

[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  ]

瞄一眼:server

[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
相關文章
相關標籤/搜索