安装在Ubuntu13.06 x64上,它是一个OpenVZ虚拟机。
按照剧本写的信,收到了一些错误.
root@dev:/# sudo apt-get install linux-image-extra-`uname -r`
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-image-extra-2.6.32-042stab081.3
E: Couldn't find any package by regex 'linux-image-extra-2.6.32-042stab081.3'
root@dev:/#虽然我能够:
root@dev:/# uname -r
2.6.32-042stab081.3
root@dev:/#然后,当我尝试安装时,我会收到以下内容(这是第二次尝试,因此很明显地被删除了)
root@dev:/# sudo apt-get install lxc-docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
lxc-docker is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up lxc (0.9.0-0ubuntu3.4) ...
start: Job failed to start
invoke-rc.d: initscript lxc-net, action "start" failed.
dpkg: error processing lxc (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of lxc-templates:
lxc-templates depends on lxc (>= 0.8.0~rc1-4ubuntu43); however:
Package lxc is not configured yet.
dpkg: error processing lxc-templates (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lxc-docker-0.6.3:
lxc-docker-0.6.3 depends on lxc; however:
Package lxc is not configured yet.
dpkg: error processing lxc-docker-0.6.3 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lxc-docker:
lxc-docker depends on lxc-docker-0.6.3; however:
Package lxc-docker-0.6.3 is not configured yet.
dpkg: error processing lxc-docker (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
lxc
lxc-templates
lxc-docker-0.6.3
lxc-docker
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@dev:/#发布于 2013-10-01 07:30:23
这里有两个截然不同的问题。
linux-image-extra-$(uname -r)包。
这是因为Docker安装脚本大胆地假设,如果您正在运行内核(例如3.8.0-30 ),那么它是从包linux-image-3.8.0-30安装的,并且应该有包含额外文件的包linux-image-extra-3.8.0-30 (包括运行Docker所必需的AUFS模块)。如果您运行的内核不是股票Ubuntu内核,这个假设将是错误的,linux-image-extra-...包将不存在,脚本将不幸失败。
但是,如果您知道您的内核中有AUFS支持(或者您的内核的AUFS模块是以某种方式安装的),那么您可以安全地跳过这个步骤。
诚然,安装脚本应该对您的环境进行更多的研究,并且只在有意义的时候尝试安装这个-extra-包。lxc容器中安装OpenVZ包。
postinstall包的lxc脚本试图启动lxc-net服务,该服务试图设置lxcbr0桥。我这里没有一个OpenVZ环境来测试这一点,但是我认为您不能在OpenVZ环境中创建一个桥。因此,服务无法启动,postinstall脚本报告一个失败,lxc包不能记录为“已安装”,如果没有正确安装其依赖项,则Docker (lxc-docker)不希望安装。
您可以通过阻止服务启动来解决此问题;例如:
回声出口101号出口sudo tee /usr/sbin/policy-rc.d sudo chmod +x /usr/sbin/policy-rc.d
但是,我几乎可以肯定,您将无法在OpenVZ中运行Docker,因为您无法在OpenVZ中运行容器。同样,我没有要测试的OpenVZ环境;但是如果这样做有效的话,我会感到非常惊讶。我强烈建议在最近的内核(例如3.8)上运行Docker,而不是在OpenVZ内部运行。
但是,如果您绝对需要在OpenVZ中运行Docker,那么有一种方法可以做到这一点,但这是非常麻烦的。将有一个性能的打击,并可能有副作用。如果您想尝试,可以检查Sekexe。它将允许您在用户模式linux内核中启动任意进程。我已经成功地使用它在Travis CI中运行Docker测试。不过,我不推荐它做任何别的事。
发布于 2014-05-05 18:16:38
我玩了一些sekexe,但我完全同意jpetazzo;它很酷,但不适合生产。相反,我开始使用debootstrap +染色的监狱来获得类似的docker体验(当然,还不如docker那么酷)。
您可能需要检查以下内容:http://coderofsalvation.github.io/debootstrap-container
我现在在OpenVZ VPS上使用它来在整洁的容器中分离包/项目。声明:我是作者。
https://stackoverflow.com/questions/19108294
复制相似问题