Yeah, I think libvirt-lxc expects the container's init process to setup
the IP address. I don't know of any plans to change that and allow
setting up the IP address from libvirt-lxc, but I'll ask the libvirt
guys.
I think I prefer something like option 2, because it more closely
resembles how networks are setup in a non-container environment. Also
it gives the container more control over its setup. For example, the
container could in theory decide to run a DHCP client instead of a
static IP (assuming docker wanted to support that).
Josh
On Wed, Aug 28, 2013 at 12:21:23PM -0700, J�r�me Petazzoni wrote:
> Nice!
>
> Regarding networking, I don't know if there are plans in libvirt-lxc to
> allow passing down the network configuration to the container (or setting
> up the interfaces right away). The following approaches are possible:
>
> (1) patching libvirt-lxc so that you can easily spec the IP address in the
> config (I think it's already possible, I'm just not familiar with the
> libvirt XMl format), then make sure that the libvirt-lxc driver can use
> that info to setup the veth interface correctly;
>
> (2) passing all needed information to .dockerinit (instead of just the
> gateway as we do now);
>
> (3) leaving the whole network setup to Docker (there is a simplified
> proof-of-concept implementation in dockerlite[1]), which is tempting but
> means that "native" management tools will see a "network-less" container,
> so it's probably sub-optimal in some scenarios.
>
> [1]
>
https://github.com/jpetazzo/dockerlite/blob/master/lib/dockerlite-runc.sh#L67
>
>
>
> On Wed, Aug 28, 2013 at 11:46 AM, Josh Poimboeuf <
jpoi...@redhat.com>wrote:
>
> > On Sun, Aug 25, 2013 at 07:42:56PM -0700, Michael Crosby wrote:
> > > On Thursday, August 22, 2013 3:42:12 PM UTC-7, J�r�me Petazzoni wrote:
> > > >
> > > > I did that earlier today, and here are my notes:
> > > >
https://github.com/dotcloud/docker/wiki/libvirt-lxc
> > > >
> > > > It's very hackish at this point, it will be helpful after 1.0 if we
> > want
> > > > a plugin to use libvirt-lxc instead of lxc-start (could be useful
> > because
> > > > libvirt supposedly plays nicer with SELinux, while lxc-start is better
> > > > integrated with AppArmor in Ubuntu).
> >
> > Hey! I've also been looking at integrating docker with libvirt-lxc. We
> > should probably all compare notes and coordinate our efforts (on IRC
> > maybe?)
> >
> > I hacked up a template file for the libvirt XML config, and called
> > libvirt-lxc from docker. Here's my work so far (ugly hack alert):
> >
> >
> >
https://github.com/jpoimboe/docker/commit/91b5b87ca3fc03150408e8a8f9f2385df9b56dfc
> >
> > BTW, I was able to get the bind mount of /.dockerinit to work, so I'm
> > not sure why that didn't work for you J�r�me. I did my testing on