是否可以在基于docker的父容器中运行基于lxc的容器?

时间:2014-10-03 23:37:01

标签: docker lxc

我有一个基于lxc的容器构建框架,我想在基于docker的容器中托管。我已经看到了嵌套基于lxc的容器的引用,但是我没有看到将它们与基于docker的父级嵌套它们。

我尝试时遇到的第一个问题是docker parent中缺少lxbr0。不确定如何解决这个问题,或者这是否是我遇到的唯一问题。

这可能吗?

以下是我尝试过的细节。

On a Ubuntu 14.04 system
@ubuntu ~ $ docker version
Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a

@ubuntu ~ $ docker run -i -t --privileged ubuntu:14.04 bash
root@d3e60c05b4f3:/# apt-get update
...
apt-get install lxc
...

root@d3e60c05b4f3:/# lxc-create -n t0 -t download -B dir -- -d centos -r 6 -a amd64
Setting up the GPG keyring
Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs

---
You just created a CentOS container (release=6, arch=amd64, variant=default)
The default root password is: root

root@d3e60c05b4f3:/# lxc-start -n t0
lxc-start: failed to attach 'veth3EUUJS' to the bridge 'lxcbr0' : No such device
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 't0'
lxc-start: The container failed to start.
lxc-start: Additional information can be obtained by setting the --logfile and --logpriority options.
root@d3e60c05b4f3:/# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 2e:48:86:e5:6d:a7  
          inet addr:172.17.0.3  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::2c48:86ff:fee5:6da7/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:50764 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27830 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:95008668 (95.0 MB)  TX bytes:1528822 (1.5 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@d3e60c05b4f3:/# 

0 个答案:

没有答案