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.

  • docker for Mac. docker run -d -p 80:80 --name webserver nginx [duplicate]
  • Postgres docker container vs. hosted solution
  • Configure Tiller with Docker
  • Docker stops immediately upon running - EOF error
  • SSH connection to my container closed by remote host
  • Populating Neo4J In Docker Container
  • 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:/# 
    

  • AAPT2 failing to merge resources on Docker
  • My 'docker run' command uses 2 cpu cores by default. How to increase it?
  • Can dockerized containers truly run on any Linux node?
  • Docker in IntelliJ IDEA for Mac not working
  • Is using linux containers (lxc) like docker is safe?
  • docker odoo 9 install pika error
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.