本文是模擬實際上線時,沒有網絡的狀況下使用rpm包安裝docker-1.7的方法。不過安裝中也是使用yum,相比較直接使用rpm安裝,yum能夠解決一些庫文件的依賴關係。linux
# cd /etc/yum.repos.d/docker
# mkdir bakapi
# mv * bak/網絡
# cd cgroup/app
# yum installlibcgroup-0.40.rc1-16.el6.x86_64.rpm測試
# 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
# yum installdocker-io-1.7.1-2.el6.x86_64.rpmspa
# yum installdevice-mapper-*3d
5.
設置開機自啓
# chkconfig docker on
unix
6.
檢查支持狀況
# lxc-checkconfig
7.
啓動cgroup
# service cgconfig start
# docker ps –a
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便可。