Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Creating template on Ubuntu

Rootfs can be downloaded from here as well: http://images.linuxcontainers.org/images/ubuntu/trusty/amd64/default/

  1. Install lxc: apt-get install lxc

  2. Create  a container with any name, in our case 'ubuntu':

    sudo lxc-create --template=debian t download -n ubuntu -- --name=dist ubuntu --release trusty --release=wheezy arch amd64


  3. Creation of the LXC container will take a lot of time, it will be stored here: /var/lib/lxc/ubuntu


  4. Next stop the container:
    sudo lxc-stop -n ubuntu


  5. Next create a temp director, tar the rootfs and export the template:
    mkdir -p /tmp/lxc-template
    cd /tmp/lxc-template
    sudo tar --numeric-owner -czf /tmp/lxc-template/template.tar.gz /var/lib/lxc/ubuntu/rootfs/
     
     

...