标签:docker基础搭建
1.升级系统的内核
cd /etc/yum.repos.d/ wget http://www.hop5.in/yum/el6/hop5.repo yum install kernel-ml-aufs kernel-ml-aufs-devel -y
default=0 set to 0 and check Centos &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [root@oldboy ~]# vim /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes tothis file # NOTICE: You have a /bootpartition. This means that # all kernel andinitrd paths are relative to /boot/, eg. # root (hd0,0) # kernel/vmlinuz-version ro root=/dev/sda3 # 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=7b76340c-8d26-421c-b2bb-802770973f88rd_NO_LU KS rd_NO_LVM.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16crashkernel=auto KEYBOARDTYPE=pc KEY TABLE=us rd_NO_DM rhgb quiet initrd/initramfs-3.10.5-3.el6.x86_64.img title CentOS 6 (2.6.32-573.el6.x86_64)
然后重启 reboot 检查系统内核: [root@oldboy ~]# uname -r 3.10.5-3.el6.x86_64 查看内核是否支持aufs [root@oldboy ~]# grep aufs /proc/filesystems nodev aufs
2.关闭selinux
[root@oldboy ~]# getenforce Disabled 没有的话关闭selinux sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
3.安装docker
在Fedora EPEL源中已经提供了docker-io包,下载安装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
4.yum 安装docker-io
yum -y install docker-io
5.启动Docker
[root@oldboy ~]# service docker start Starting cgconfig service: [确定] Starting docker: [确定] [root@oldboy ~]#
6.查看docker的版本
[root@oldboy ~]# 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 [root@oldboy ~]#
7.查看Docker的日志
[root@oldboy ~]# cat /var/log/docker \n2016年 08月 02日星期二 17:08:53 CST\n time="2016-08-02T17:08:53.628209179+08:00" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)" time="2016-08-02T17:08:53.765733247+08:00" level=warning msg="Running modprobe bridge nf_nat failed with message: insmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/llc/llc.ko \ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/802/stp.ko \ninstall /sbin/modprobe --ignore-install bridge && /sbin/sysctl -q -w net.bridge.bridge-nf-call-arptables=0 net.bridge.bridge-nf-call-iptables=0 net.bridge.bridge-nf-call-ip6tables=0\ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/bridge/bridge.ko \ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/netfilter/nf_conntrack.ko \ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/netfilter/nf_nat.ko \n, error: exit status 1" time="2016-08-02T17:08:54.018750099+08:00" level=warning msg="Your kernel does not support swap memory limit." time="2016-08-02T17:08:54.019550061+08:00" level=info msg="Loading containers: start." time="2016-08-02T17:08:54.019778904+08:00" level=info msg="Loading containers: done." time="2016-08-02T17:08:54.019801548+08:00" level=info msg="Daemon has completed initialization" time="2016-08-02T17:08:54.019823924+08:00" level=info msg="Docker daemon" commit="786b29d/1.7.1" execdriver=native-0.2 graphdriver=aufs version=1.7.1 time="2016-08-02T17:10:12.131694594+08:00" level=info msg="GET /v1.19/version" [root@oldboy ~]#
本文出自 “砖家博客” 博客,请务必保留此出处http://wsxxsl.blog.51cto.com/9085838/1833624
标签:docker基础搭建
原文地址:http://wsxxsl.blog.51cto.com/9085838/1833624