1、在centos下安装docker,首先查看内核版本信息
[joe@SZ~]$
uname-r
3.2.69
2、安装EPEL Repository
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
3、更新安装包
yum update -y
将其中的baseurl启用,mirrorlist注释掉。
4、安装docker
yum install docker-io -y
N.B. :安装完成后执行docker ps -a 命令报:
AreyoutryingtoconnecttoaTLS-enableddaemonwithoutTLS
5、启动docker daemon
service docker start
可以将docker配置成server boot时启动
chkconfig docker on
6、执行docker ps -a命令报:
CannotconnecttotheDockerdaemon.Is'docker-d'runningonthishost?
执行docker -d命令后又报错误:
[
root@SZjoe]#docker-d
INFO[0000]ListeningforHTTPonunix(/var/run/docker.sock)
WARN[0000]Youarerunninglinuxkernelversion3.2.69,whichmightbeunstablerunningdocker.Pleaseupgradeyourkernelto3.10.0.
INFO[0000][graphdriver]usingpriorstoragedriver"devicemapper"
WARN[0000]Runningmodprobebridgenf_natFailedwithmessage:,error:exitstatus1
FATA[0000]Errorstartingdaemon:Errorinitializingnetworkcontroller:Errorcreatingdefault"bridge"network:FailedtocreateNATchain:FailedtoinjectdockerinPREROUTINGchain:iptablesFailed:iptables-tnat-APREROUTING-maddrtype--dst-typeLOCAL-jDOCKER:iptables:Nochain/target/matchbythatname.
(exitstatus1)
后来发现重启之后就好了。
参考网址:
原文链接:https://www.f2er.com/centos/381289.html