Is it possible to run lxc based containers inside a docker based parent container?

I have an existing lxc based container building framework that I’d like to host inside of a docker based container. I’ve seen references to nesting lxc based containers, but I’ve seen nothing about nesting them with a docker based parent.

First problem I run into when I try it is lxbr0 is missing in the docker parent. Not sure how to resolve that or if that’s the only problem I’ll run into.

  • Postgres to Ubuntu Docker container linking not working
  • Dokku: Listen to multiple ports from an app
  • Docker Registry and Basic Auth
  • Conventional way to resolve docker derived image build time vs. image size tradeoff
  • marathon + mesos + networking + docker-compose
  • How can I schedule tasks to CPUs?
  • Is this possible?

    Here are the details of what I’ve tried.

    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:/# 
    

  • PyCharm remote debug in a docker container
  • How to change docker daemon root directory in CentOS7
  • How to view logs for a docker image?
  • Best Practice to run commands after starting up a prebuilt docker image
  • nginx no such file or directory
  • Deploy ASP.NET core to Azure Container Service (Swarm mode)
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.