How to create an LXC container without rootfs

I want to create a container without "rootfs" in lxc 1.0.5 and Ubuntu 14.04.

I did this before in previous versions of lxc. In previous versions, if we use lxc-create without the "-t" option, it will create a container without "rootfs".

so I try:

lxc-create -n foo 

and I got this error:

 lxc_container: Error creating container foo 

I read the new lxc-create man page. The new manpage says:

  -t template
               'template' is the short name of an existing 'lxc-template'
               script that is called by lxc-create, eg.  busybox, debian,
               fedora, ubuntu or sshd.  Refer to the examples in
               / usr / local / share / lxc / templates for details of the expected
               script structure.  Alternatively, the full path to an
               executable template script can also be passed as a parameter.
               "none" can be used to force lxc-create to skip rootfs
               creation.

I tried:

 lxc-create -n foo -t none 

and I get the error again:

 lxc_container: No such file or directory - bad template: none lxc_container: bad template: none lxc_container: Error creating container foo 

What am I doing wrong?

+6
source share
1 answer

Don't you hate when reality changes, but documentation doesn't work?

Try using -t / bin / true

+11
source

Source: https://habr.com/ru/post/976910/


All Articles