赞
踩
1.由于是离线下载,需要提前下载好需要的依赖包
2.使用的版本为Centos6.5
3.不升级内核
1.安装downloadonly插件使用yum下载rpm包
# yum install yum-plugin-downloadonly
使用方法:
yum install --downloadonly(只下载不安装) --downloaddir=rpm包下载的目录 安装的组件名
2.下载docker需要的依赖包
2.1配置Fedora EPEL源
# yum install http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
2.2 添加hop5.repo源
- # cd /etc/yum.repos.d
- # wget http://www.hop5.in/yum/el6/hop5.repo
2.3下载依赖包
- # mkdir /usr/local/docker
- # yum install --downloadonly --downloaddir=/usr/local/docker docker-io
这一步会报错找不到对应的rpm包;原因是对应的rpm包的版本号改变了,复制没有下载的rpm包的包名(不带版本号),进入下面的网址:
http://mirrors.aliyun.com/epel/6/x86_64/
找到对应的包名的rpm包,比如这里提示lxc-1.0.8-1.el6.x86_64.rpm
包下载失败,在上面的网址中找到lxc-1.0.9-1.el6.x86_64.rpm
,复制链接地址,http://mirrors.aliyun.com/epel/6/x86_64/lxc-1.0.9-1.el6.x86_64.rpm
- # cd /usr/local/docker
- # wget http://mirrors.aliyun.com/epel/6/x86_64/lxc-1.0.9-1.el6.x86_64.rpm
就可以下载对应的包了
2.4下载device-mapper-libs,不下载后面启动docker会报错
- # mkdir /usr/local/docker/device-mapper-libs
- # yum install --downloadonly --downloaddir=/usr/local/docker/device-mapper-libs device-mapper-libs
2.5 将整个docker目录拷贝到需要安装docker的离线的节点上的/usr/local/src目录下
1.安装docker
- # cd /usr/local/src/docker
- # rpm -ivh lxc-libs-1.0.9-1.el6.x86_64.rpm
- # rpm -ivh lua-alt-getopt-0.7.0-1.el6.noarch.rpm
- # rpm -ivh lua-filesystem-1.4.2-1.el6.x86_64.rpm
- # rpm -ivh lua-lxc-1.0.9-1.el6.x86_64.rpm
- # rpm -ivh lxc-1.0.9-1.el6.x86_64.rpm
- # rpm -ivh docker-io-1.7.1-2.el6.x86_64.rpm
2.运行docker -d
命令报错如下:
docker: relocation error: docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
2.1解决如下
- # cd /usr/local/src/docker/device-mapper-libs
- # yum -y install device-mapper*
3.再次运行docker -d
命令,报错如下:
FATA[0000] Error mounting devices cgroup: mountpoint for devices not found
3.1解决如下:
- # vi /etc/fstab
- #在结尾添加
- none /sys/fs/cgroup cgroup defaults 0 0
-
- #重启
- # reboot
4.再次运行docker -d
;放到后台运行
- # mkidr /usr/local/docker
- # cd /usr/local/docker
- # nohup docker -d &
- # tail -f nohup.out
如果没有报错信息,就说明安装成功!
链接:https://www.jianshu.com/p/ead7385fb418
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。