一、查看系统版本
[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
二、安装EPEL
1.进入centos6系列EPEL下载地址
http://download.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.html
2. wget下载
[root@localhost ~]# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
--2015-09-10 17:50:49-- http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
正在解析主机 download.fedoraproject.org... 67.219.144.68, 209.132.181.16, 66.35.62.162, ...
正在连接 download.fedoraproject.org|67.219.144.68|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:http://mirrors.opencas.cn/epel/6/i386/epel-release-6-8.noarch.rpm [跟随至新的 URL]
--2015-09-10 17:50:50-- http://mirrors.opencas.cn/epel/6/i386/epel-release-6-8.noarch.rpm
正在解析主机 mirrors.opencas.cn... 159.226.11.160, 2001:cc0:2004:1:225:90ff:fe00:fe8b, 2001:cc0:2004:1:225:90ff:fe3a:e6b5
正在连接 mirrors.opencas.cn|159.226.11.160|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:14540 (14K) [application/x-redhat-package-manager]
正在保存至: “epel-release-6-8.noarch.rpm”
100%[=======================================================================================================>] 14,540 12.9K/s in 1.1s
2015-09-10 17:50:56 (12.9 KB/s) - 已保存 “epel-release-6-8.noarch.rpm” [14540/14540])
3.rpm安装EPEL(我已经安装过了,所以显示已经安装了)
[root@localhost ~]# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
package epel-release-6-8.noarch is already installed
4.安装好EPEL 源后,用yum 命令来检查是否添加到源列表
root@localhost ~]# yum repolist
已加载插件:fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* epel: mirror01.idc.hinet.net
* extras: mirrors.163.com
* updates: mirrors.163.com
仓库标识 仓库名称 状态
base CentOS-6 - Base 6,575
*epel Extra Packages for Enterprise Linux 6 - x86_64 11,766
extras CentOS-6 - Extras 35
updates CentOS-6 - Updates 298
repolist: 18,674
5.bingo,已经添加。进行缓存。
[root@localhost ~]# yum makecache
已加载插件:fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error was
12: Timeout on https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
* base: mirrors.hust.edu.cn
* epel: ftp.cuhk.edu.hk
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
元数据缓存已建立
三、禁用selinux
1.查看selinux状态
?
2.修改该配置文件中将enforcing替换为disabled
?
3.reboot重启一下系统,使生效。
四、准备就绪,安装docker-io,摸摸哒。
[root@localhost ~]# yum install docker-io
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
?
总下载量:5.1 M
Installed size: 20 M
确定吗?[y/N]:
还需要我解释么,一路y下去。
启动我们的宝贝docker
[root@localhost ~]# /etc/init.d/docker start
Starting cgconfig service: [确定]
Starting docker: [确定]
查看docker进程
[root@localhost ~]# ps -ef | grep docker
root 3602 1 0 18:26 pts/0 00:00:00 /usr/bin/docker -d
root 3745 3429 0 18:27 pts/0 00:00:00 grep docker
查看安装的docker版本
Status: Downloaded newer image for centos:latest
[root@localhost ~]# 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@localhost ~]# uname -r
2.6.32-573.3.1.el6.x86_64
docker官方文档说要求Linux kernel至少3.8以上。
在一个新的终端里守护模式运行docker时,会出现warning
[root@localhost ~]# docker -d
WARN[0000] You are running linux kernel version 2.6.32-573.3.1.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.10.0.
但是目前表示我可以正常使用。
|