docker容器最先受到RHEL完善的支持是從最近的CentOS 7.0開始的,官方說明是隻能運行於64位架構平臺,內核版本爲2.6.32-431及以上(即>=CentOS 6.5,運行docker時實際提示3.8.0及以上)。
須要注意的是CentOS 6.5與7.0的安裝是有一點點不一樣的,CentOS-6上docker的安裝包叫docker-io,而且來源於Fedora epel庫,這個倉庫維護了大量的沒有包含在發行版中的軟件,因此先要安裝EPEL,而CentOS-7的docker直接包含在官方鏡像源的Extras倉庫(CentOS-Base.repo下的[extras]節enable=1啓用)。前提是都須要聯網,具體安裝過程以下。linux
一、禁用selinux
docker
# vi /etc/selinux/config SELINUX=disabled ...
二、安裝 Fedora EPELshell
# yum install epel-release-6-8.noarch //或 yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
三、檢查內核版本架構
# uname -r2.6.32-431.el6.x86_64 # cat /etc/redhat-release CentOS release 6.5 (Final)
看到這個最低的內核版本,事實運行起來是沒太大問題的,你也能夠升級到3.10.x版本。app
四、安裝 docker-iolua
# yum install docker-io Dependencies Resolved =========================================================================================== Package Arch Version Repository Size =========================================================================================== Installing: docker-io x86_64 1.1.2-1.el6 epel 4.5 M Installing for dependencies: 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.6-1.el6 epel 15 k lxc x86_64 1.0.6-1.el6 epel 120 k lxc-libs x86_64 1.0.6-1.el6 epel 248 k Transaction Summary =========================================================================================== Install 6 Package(s)
五、啓動試運行spa
# service docker start //或 # docker -d
六、異常code
/usr/bin/docker: relocation error: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
請升級ci
yum install device-mapper-event-libs