在Docker守护程序中初始化网络控制器时发生错误。
在Docker守护程序中初始化网络控制器时发生错误。
我正在尝试在一台安装了OracleLinux 6的虚拟服务器上安装Docker,按照官方文档的步骤进行操作。我已经将内核更新到uekr 4版本。
这是我的Docker版本:
#docker version Client: Version: 1.12.3 API version: 1.24 Go version: go1.6.3 Git commit: 6b644ec Built: OS/Arch: linux/amd64 无法连接到Docker守护程序。Docker守护程序是否在此主机上运行?
当我启动守护程序时,它显示OK,但立即关闭。
#service docker start Starting docker: . [ OK ] #service docker status docker dead but subsys locked
这是日志:
\nWed Nov 23 07:53:00 GMT 2016\n time="2016-11-23T07:53:00.610036664Z" level=info msg="libcontainerd: new containerd process, pid: 5114" time="2016-11-23T07:53:00.649075962Z" level=warning msg="containerd: low RLIMIT_NOFILE changing to max" current=1024 max=4096 time="2016-11-23T07:53:01.690428304Z" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section." time="2016-11-23T07:53:01.766503952Z" level=warning msg="devmapper: Base device already exists and has filesystem ext4 on it. User specified filesystem will be ignored." time="2016-11-23T07:53:01.788944031Z" level=info msg="[graphdriver] using prior storage driver \"devicemapper\"" time="2016-11-23T07:53:01.793561685Z" level=info msg="Graph migration to content-addressability took 0.00 seconds" time="2016-11-23T07:53:01.794228177Z" level=warning msg="mountpoint for pids not found" time="2016-11-23T07:53:01.794714149Z" level=info msg="Loading containers: start." time="2016-11-23T07:53:01.996320180Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" time="2016-11-23T07:53:02.101877068Z" level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: package not installed"
它显示“package not installed”,但是当我运行sudo modinfo bridge时,它显示了该模块。我是否还缺少其他软件包?
我尝试在/etc/sysconfig/docker中设置环境变量,也尝试通过二进制文件进行安装,还尝试创建用户并将其添加到docker组。我尝试了许多其他解决方案,例如:
- [Docker service does not start](https://stackoverflow.com/questions/30132706/docker-service-does-not-start)
- [Cannot connect to docker daemon](https://stackoverflow.com/questions/38971668/cannot-connect-to-docker-daemon)
- [Docker command can't connect to Docker daemon](https://stackoverflow.com/questions/33562109/docker-command-cant-connect-to-docker-daemon)
但是没有一个解决方案有效!有人可以帮助我吗?
(Error initializing network controller in docker daemon)这个问题的出现的原因可能是在Oracle Linux 6上安装Docker时引发的问题。解决方法是安装docker-io-1.6.2-3.el6.x86_64.rpm而不是docker-engine,并在安装之前下载一些其他Docker所需的库。以下是具体的解决步骤:
1. 下载docker-io软件包。可以在https://dl.fedoraproject.org/pub/epel/testing/6/x86_64/找到。
2. 下载一些其他Docker所需的库。
- 编辑yum.repos.d文件,根据你的Oracle Linux 6进行修改。
- 执行以下命令:
cd /etc/yum.repos.d wget http://www.hop5.in/yum/el6/hop5.repo yum update
3. 安装RPM文件并启动Docker。
- 执行以下命令:
rpm -ivh docker-io-1.6.2-3.el6.x86_64.rpm service docker start
如果在给定的链接中没有找到docker-io-1.6.2,可以尝试使用其他版本。如果想要使用Docker,建议将Oracle Linux升级到版本7。如果无法升级,可能需要在互联网上查找docker-io-1.6.2-3.el6.x86_64.rpm软件包。