centos不升级内核安装docker
之前在centos6.5下安装了docker,但考虑到很多机器不能升级内核并也要安装docker,还好已经有人在不升级内核的情况下把docker安装成功了.
系统:centos 6.5(64位)
1.关闭selinux
vi /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
2.安装Fedora EPEL源
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
3.添加hop5.repo源
wget http://www.hop5.in/yum/el6/hop5.repo -P /etc/yum.repos.d/
4.安装docker
yum install docker-io* device-mapper-event-libs
ps:这里要说一句epel(企业版 Linux 附加软件包)只提供64位的docker安装包,所以在32位的系统是没办法通过yum安装的.只能将64位的docker源代码变成32位才能安装,或安装64位的系统.所以我建议32位的系统还是不要用这篇文章的安装方法了.
5.启动docker并验证
vi /etc/sysconfig/iptables
保存后,执行下面的命令:
service docker start
docker images
好了,docker已经安装成功,就可以去自己pull镜像了.
系统:centos 6.5(64位)
1.关闭selinux
vi /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
2.安装Fedora EPEL源
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
3.添加hop5.repo源
wget http://www.hop5.in/yum/el6/hop5.repo -P /etc/yum.repos.d/
4.安装docker
yum install docker-io* device-mapper-event-libs
ps:这里要说一句epel(企业版 Linux 附加软件包)只提供64位的docker安装包,所以在32位的系统是没办法通过yum安装的.只能将64位的docker源代码变成32位才能安装,或安装64位的系统.所以我建议32位的系统还是不要用这篇文章的安装方法了.
5.启动docker并验证
vi /etc/sysconfig/iptables
*nat :PREROUTING ACCEPT [27:11935] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [598:57368] :POSTROUTING ACCEPT [591:57092] :DOCKER - [0:0] -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER -A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER -A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE COMMIT # Completed on Sun Sep 20 17:35:31 2015 # Generated by iptables-save v1.4.21 on Sun Sep 20 17:35:31 2015 *filter :INPUT ACCEPT [139291:461018923] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [127386:5251162] :DOCKER - [0:0] -A FORWARD -o docker0 -j DOCKER -A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A FORWARD -i docker0 ! -o docker0 -j ACCEPT -A FORWARD -i docker0 -o docker0 -j ACCEPT COMMIT
保存后,执行下面的命令:
service docker start
docker images
好了,docker已经安装成功,就可以去自己pull镜像了.
ps:
http://speakingbaicai.blog.51cto.com/5667326/1353183
http://cn.soulmachine.me/blog/20131025/
评论: