Offline container creation

(Sylekta) #1

If I want to create a container offline, whats the best way to do it? I have grabbed the meta and rootfs tarballs from the jenkins server, how do I use them with lxc? Also is anyone familiar with the ansible module lxc_container, same deal can I have those tarballs somewhere and force the module to create using local cache? The machine I need to build container on does not have internet access

(Stéphane Graber) #2

Depends if LXC or LXD.

For LXC, you’d use the lxc-local template (-t local option to lxc-create).
For LXD, you’d import the two tarballs together with (lxc image import --alias my-image meta-tarball root-tarball) and then use lxc launch my-image some-name.

(Sylekta) #3

Thanks for the reply, using LXC. Can you provide an example of using -t local?

(Stéphane Graber) #4

Looks like it’s lxc-create -t local -n some-name -- -m /path/to/meta.tar.xz -f /path/to/rootfs.tar.xz