如何在没有rootfs的情况下创建LXC容器

时间:2014-10-18 16:55:44

标签: lxc

我想创建一个没有" rootfs"的容器。在lxc 1.0.5和Ubuntu 14.04中。

之前在lxc的早期版本中我做过。在以前的版本中,如果我们使用lxc-create而不使用" -t"选项,它将创建一个没有" rootfs"。

的容器

所以我试试:

lxc-create -n foo

我收到了这个错误:

lxc_container: Error creating container foo

我阅读了新的lxc-create联机帮助页。新的manpage说:

       -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.

我试试看:

lxc-create -n foo -t none

我再次收到错误:

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

我做错了什么?

1 个答案:

答案 0 :(得分:12)

当现实发生变化时,你不是讨厌它,但是文档没有?

尝试使用-t / bin / true

相关问题