您的位置:首页 > 运维架构 > Docker

CentOS 6.8上安装 docker.io

2017-04-06 14:44 627 查看

CentOS 6.8上安装 docker.io

docker是什么就不多说了,见docker基础原理介绍

docker容器最早受到RHEL完善的支持是从最近的CentOS 7.0开始的,官方说明是只能运行于64位架构平台,内核版本为2.6.32-431及以上(即>=CentOS 6.5,运行docker时实际提示3.8.0及以上),升级内核请参考CentOS 6.x 内核升级(2.6.32 -> 3.10.58)过程记录

需要注意的是CentOS 6.5与7.0的安装是有一点点不同的,CentOS-6上docker的安装包叫docker-io,并且来源于Fedora epel库,这个仓库维护了大量的没有包含在发行版中的软件,所以先要安装EPEL,而CentOS-7的docker直接包含在官方镜像源的Extras仓库(CentOS-Base.repo下的[extras]节enable=1启用)。前提是都需要联网,具体安装过程如下。

1. 禁用selinux

# vi /etc/selinux/config
SELINUX=disabled
# getenforce
Enforcing
# setenforce 0


2. 安装 Fedora EPEL

epel-release-6-8.noarch.rpm包在发行版的介质里面已经自带了,可以从rpm安装。

# yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
epel-release-6-8.noarch.rpm                                                                |  14 kB     00:00
诊断 /var/tmp/yum-root-VWK1bL/epel-release-6-8.noarch.rpm: epel-release-6-8.noarch
/var/tmp/yum-root-VWK1bL/epel-release-6-8.noarch.rpm 将被安装
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
解决依赖关系
--> 执行事务检查
---> Package epel-release.noarch 0:6-8 will be 安装
--> 完成依赖关系计算

依赖关系解决

==================================================================================================================
软件包                     架构                 版本                仓库                                    大小
==================================================================================================================
正在安装:
epel-release               noarch               6-8                 /epel-release-6-8.noarch                22 k

事务概要
==================================================================================================================
Install       1 Package(s)

总文件大小:22 k
Installed size: 22 k
下载软件包:
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装   : epel-release-6-8.noarch                                                                        1/1
Verifying  : epel-release-6-8.noarch                                                                        1/1

已安装:
epel-release.noarch 0:6-8
完毕!


3. 检查内核版本

# uname -r
2.6.32-642.el6.x86_64
# cat /etc/redhat-release
CentOS release 6.8 (Final)


4. 安装 docker-io

# yum install docker-io
已加载插件:fastestmirror, refresh-packagekit, security
设置安装进程
Loading mirror speeds from cached hostfile
epel/metalink                                                                              | 4.5 kB     00:00
* base: centos.ustc.edu.cn
* epel: mirror01.idc.hinet.net
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
解决依赖关系
--> 执行事务检查
---> Package docker-io.x86_64 0:1.7.1-2.el6 will be 安装
--> 处理依赖关系 lxc,它被软件包 docker-io-1.7.1-2.el6.x86_64 需要
--> 处理依赖关系 libcgroup,它被软件包 docker-io-1.7.1-2.el6.x86_64 需要
--> 执行事务检查
---> Package libcgroup.x86_64 0:0.40.rc1-23.el6 will be 安装
---> Package lxc.x86_64 0:1.0.9-1.el6 will be 安装
--> 处理依赖关系 lua-lxc(x86-64) = 1.0.9-1.el6,它被软件包 lxc-1.0.9-1.el6.x86_64 需要
--> 处理依赖关系 lua-alt-getopt,它被软件包 lxc-1.0.9-1.el6.x86_64 需要
--> 处理依赖关系 liblxc.so.1()(64bit),它被软件包 lxc-1.0.9-1.el6.x86_64 需要
--> 执行事务检查
---> Package lua-alt-getopt.noarch 0:0.7.0-1.el6 will be 安装
---> Package lua-lxc.x86_64 0:1.0.9-1.el6 will be 安装
--> 处理依赖关系 lua-filesystem,它被软件包 lua-lxc-1.0.9-1.el6.x86_64 需要
---> Package lxc-libs.x86_64 0:1.0.9-1.el6 will be 安装
--> 执行事务检查
---> Package lua-filesystem.x86_64 <
4000
span class="hljs-number">0:1.4.2-1.el6 will be 安装
--> 完成依赖关系计算

依赖关系解决

==================================================================================================================
软件包                         架构                   版本                            仓库                  大小
==================================================================================================================
正在安装:
docker-io                      x86_64                 1.7.1-2.el6                     epel                 4.6 M
为依赖而安装:
libcgroup                      x86_64                 0.40.rc1-23.el6                 base                 131 k
lua-alt-getopt                 noarch                 0.7.0-1.el6                     epel                 6.9 k
lua-filesystem                 x86_64                 1.4.2-1.el6                     epel                  24 k
lua-lxc                        x86_64                 1.0.9-1.el6                     epel                  16 k
lxc                            x86_64                 1.0.9-1.el6                     epel                 122 k
lxc-libs                       x86_64                 1.0.9-1.el6                     epel                 257 k

事务概要
==================================================================================================================
Install       7 Package(s)

总下载量:5.1 M
Installed size: 20 M
确定吗?[y/N]:y
下载软件包:
(1/7): docker-io-1.7.1-2.el6.x86_64.rpm                                                                                                                                                   | 4.6 MB     00:19
(2/7): libcgroup-0.40.rc1-23.el6.x86_64.rpm                                                                                                                                               | 131 kB     00:00
(3/7): lua-alt-getopt-0.7.0-1.el6.noarch.rpm                                                                                                                                              | 6.9 kB     00:00
(4/7): lua-filesystem-1.4.2-1.el6.x86_64.rpm                                                                                                                                              |  24 kB     00:00
(5/7): lua-lxc-1.0.9-1.el6.x86_64.rpm                                                                                                                                                     |  16 kB     00:00
(6/7): lxc-1.0.9-1.el6.x86_64.rpm                                                                                                                                                         | 122 kB     00:02
(7/7): lxc-libs-1.0.9-1.el6.x86_64.rpm                                                                                                                                                    | 257 kB     00:01
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                                                             187 kB/s | 5.1 MB     00:28
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) <epel@fedoraproject.org>
Package: epel-release-6-8.noarch (@/epel-release-6-8.noarch)
From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
确定吗?[y/N]:y
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-8.el6.centos.12.3.x86_64 (@base/$releasever)
From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
确定吗?[y/N]:y
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装   : lxc-libs-1.0.9-1.el6.x86_64                                                                                                                                                             1/7
正在安装   : lua-filesystem-1.4.2-1.el6.x86_64                                                                                                                                                             2/7
正在安装   : lua-lxc-1.0.9-1.el6.x86_64                                                                                                                                                                    3/7
正在安装   : libcgroup-0.40.rc1-23.el6.x86_64                                                                                                                                                              4/7
正在安装   : lua-alt-getopt-0.7.0-1.el6.noarch                                                                                                                                                             5/7
正在安装   : lxc-1.0.9-1.el6.x86_64                                                                                                                                                                        6/7
正在安装   : docker-io-1.7.1-2.el6.x86_64                                                                                                                                                                  7/7
Verifying  : lua-lxc-1.0.9-1.el6.x86_64                                                                                                                                                                    1/7
Verifying  : lxc-libs-1.0.9-1.el6.x86_64                                                                                                                                                                   2/7
Verifying  : lxc-1.0.9-1.el6.x86_64                                                                                                                                                                        3/7
Verifying  : docker-io-1.7.1-2.el6.x86_64                                                                                                                                                                  4/7
Verifying  : lua-alt-getopt-0.7.0-1.el6.noarch                                                                                                                                                             5/7
Verifying  : libcgroup-0.40.rc1-23.el6.x86_64                                                                                                                                                              6/7
Verifying  : lua-filesystem-1.4.2-1.el6.x86_64                                                                                                                                                             7/7

已安装:
docker-io.x86_64 0:1.7.1-2.el6

作为依赖被安装:
libcgroup.x86_64 0:0.40.rc1-23.el6   lua-alt-getopt.noarch 0:0.7.0-1.el6   lua-filesystem.x86_64 0:1.4.2-1.el6   lua-lxc.x86_64 0:1.0.9-1.el6   lxc.x86_64 0:1.0.9-1.el6   lxc-libs.x86_64 0:1
b9ca
.0.9-1.el6

完毕!


启动试运行

# service docker start
//或
# docker -d
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  centos docker