[lxc-devel] How to use download template in offline mode

Stéphane Graber stgraber at ubuntu.com
Fri Jul 11 14:01:17 UTC 2014


On Fri, Jul 11, 2014 at 01:48:56PM +0530, Ajith Adapa wrote:
> Hi,
> 
> I am trying to write a sample app in C using lxc_api's.
> 
> My current linux box has no internet connection but I have downloaded
> tar files for rootfs and meta from images.linuxcontainers.org.
> 
> Is there a way I can specify the path to these tar files so that
> creation of container wont fail ?

It's not entirely trivial to do, but possible nonetheless.

So, let's say you downloaded the ubuntu trusty amd64 tarballs, you need to do:
 - mkdir -p /var/cache/lxc/download/ubuntu/trusty/amd64/default/
 - copy rootfs.tar.xz in /var/cache/lxc/download/ubuntu/trusty/amd64/default/
 - unpack the content of meta.tar.xz in /var/cache/lxc/download/ubuntu/trusty/amd64/default/
 - Then run the download template with: -d ubuntu -r trusty -a amd64

It'll then tell you that it found a cache copy and it'll use it rather
than attempt a download.


> 
> Regards,
> Ajith
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140711/e2783d32/attachment.sig>


More information about the lxc-devel mailing list