[Lxc-users] [lxc-devel] Working LXC templates?

Shridhar Daithankar ghodechhap at ghodechhap.net
Mon Sep 9 11:53:40 UTC 2013


On Monday, September 09, 2013 07:28:43 AM Michael H. Warfield wrote:
> In the git-stage current Fedora template, the entire problem is embodied
> in the "download_fedora" function starting around line 201...  The
> gotcha's are three commands around line 272 after we've identified and
> downloaded the initial release rpm.  We have this:
> 
>     mkdir -p $INSTALL_ROOT/var/lib/rpm
>     rpm --root $INSTALL_ROOT  --initdb
>     rpm --root $INSTALL_ROOT -ivh ${INSTALL_ROOT}/${RELEASE_RPM}
>     $YUM install $PKG_LIST
> 
> Ok...  Those are running in the host local run time environment.
> Obviously, if the host does not have a (compatible) version of rpm
> and/or yum in the host local environment, you're screwed.  That's the
> catch-22 situation and it's the same situation with zypper in the
> OpenSuse template.  That short space of code has to be recreated in a
> totally distro-agnostic manner so it runs on any distro to create our
> initial rootfs.  After that, we can do what ever distro (Fedora)
> specific commands we want by chrooting into the target container first
> (including rebuilding the rpm database to the target version).  That's
> only even needed if you don't already have a cached rootfs for that
> distro and version.

Another approach could be to popularize the container downloads by the distro. 
If each distro. could add a .tar.gz for a working container of a given 
release, one could just download and configure them, no?

then the lxc project upstream, could just list those links or include them in 
the a separate tool, that just downloads and untars the same?

That would completely sidestep the bootstrapping one-distro.-on-another 
problem.


-- 
Regards
 Shridhar




More information about the lxc-users mailing list