CentOS-6.5離線安裝docker-1.7教程

CentOS-6.5離線安裝docker-1.7教程

0.  準備

本文是模擬實際上線時,沒有網絡的狀況下使用rpm包安裝docker-1.7的方法。不過安裝中也是使用yum,相比較直接使用rpm安裝,yum能夠解決一些庫文件的依賴關係。linux

# cd /etc/yum.repos.d/docker

# mkdir bakapi

# mv * bak/網絡

1.  安裝libcgroup

# cd cgroup/app

# yum installlibcgroup-0.40.rc1-16.el6.x86_64.rpm測試

2.  安裝lxc

# yum installlua-filesystem-1.4.2-1.el6.x86_64.rpm lua-alt-getopt-0.7.0-1.el6.noarch.rpmlxc-libs-1.0.7-2.el6.x86_64.rpm lxc-1.0.7-2.el6.x86_64.rpmlua-lxc-1.0.7-2.el6.x86_64.rpmlua

3.  安裝docker

# yum installdocker-io-1.7.1-2.el6.x86_64.rpmspa

4.  更新device-mapper-libs

# yum installdevice-mapper-*3d

5.    設置開機自啓

# chkconfig docker onunix

6.    檢查支持狀況

# lxc-checkconfig

7.    啓動cgroup

# service cgconfig start

8.  啓動docker

9.  測試

# docker ps –a

 

10.        常見錯誤

l 啓動docker報錯,錯誤log:

INFO[0000] +jobserveapi(unix:///var/run/docker.sock)

INFO[0000] Listening forHTTP on unix (/var/run/docker.sock)

INFO[0000] WARNING: You arerunning linux kernel version 2.6.32-504.8.1.el6.x86_64, which might be unstablerunning docker. Please upgrade your kernel to 3.8.0.

docker: relocationerror: docker: symbol dm_task_get_info_with_deferred_remove, version Base notdefined in file libdevmapper.so.1.02 with link time reference

緣由:是由於libdevmapper版本太舊,須要update。執行步驟4便可。

 

l 啓動docker出錯,錯誤log爲:

[root@csv-bdyx01yum.repos.d]# docker -d &

[1] 7449

[root@csv-bdyx01yum.repos.d]# WARN[0000] You are running linux kernel version2.6.32-431.el6.x86_64, which might be unstable running docker. Please upgradeyour kernel to 3.10.0.

INFO[0000] [graphdriver]using prior storage driver "devicemapper"

INFO[0000] Listening forHTTP on unix (/var/run/docker.sock)

WARN[0000] Running modprobebridge nf_nat failed with message: , error: exit status 1

WARN[0000] Yourkernel does not support cgroup memory limit: mountpoint for memory not found

WARN[0000]mountpoint for cpu not found                

FATA[0000] Errormounting devices cgroup: mountpoint for devices not found

緣由:cgconfig未啓動。執行步驟7便可。

相關文章
相關標籤/搜索