首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >lxc命令lxc开始和lxc启动等有什么区别?

lxc命令lxc开始和lxc启动等有什么区别?
EN

Stack Overflow用户
提问于 2020-08-03 14:23:19
回答 3查看 812关注 0票数 3

从文档中还不清楚lxc start和lxc-start和--help之间有什么不同,它们提供了不同的用法和开关。教程使用了这两种变体,但深入研究了文档,似乎lxc适合于在容器中运行的应用程序,而lxc则用于启动容器。不管是哪种方式,都不清楚,因为它不能解释命令是彼此之间的链接还是完全不同。我错误地站在“他们是不同的,就像在不同的二进制文件,不同的代码路径,但最终收敛在引擎盖下经过一些修改”。

文档:http://manpages.ubuntu.com/manpages/bionic/man1/lxc-start.1.html

代码语言:javascript
复制
$ lxc-start --help
Usage: lxc-start --name=NAME -- COMMAND

lxc-start start COMMAND in specified container NAME

Options :
  -n, --name=NAME        NAME of the container
  -d, --daemon           Daemonize the container (default)
  -F, --foreground       Start with the current tty attached to /dev/console
  -p, --pidfile=FILE     Create a file with the process id
  -f, --rcfile=FILE      Load configuration file FILE
  -c, --console=FILE     Use specified FILE for the container console
  -L, --console-log=FILE Log container console output to FILE
  -C, --close-all-fds    If any fds are inherited, close them
                         If not specified, exit with failure instead
                         Note: --daemon implies --close-all-fds
  -s, --define KEY=VAL   Assign VAL to configuration variable KEY
      --share-[net|ipc|uts]=NAME Share a namespace with another container or pid

Common options :
  -o, --logfile=FILE               Output log to FILE instead of stderr
  -l, --logpriority=LEVEL          Set log priority to LEVEL
  -q, --quiet                      Don't produce any output
  -P, --lxcpath=PATH               Use specified container path
  -?, --help                       Give this help list
      --usage                      Give a short usage message
      --version                    Print the version number

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

See the lxc-start man page for further information.

文档:http://manpages.ubuntu.com/manpages/bionic/man7/lxc.7.html

代码语言:javascript
复制
$ lxc start --help
Usage: lxc start [<remote>:]<container> [[<remote>:]<container>...]

Start containers.

Options:
    --debug  (= false)
        Enable debug mode
    --force-local  (= false)
        Force using the local unix socket
    --no-alias  (= false)
        Ignore aliases when determining what command to run
    --stateful  (= false)
        Store the container state (only for stop)
    --stateless  (= false)
        Ignore the container state (only for start)
    --verbose  (= false)
        Enable verbose mode
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-08-04 13:35:14

来自https://discuss.linuxcontainers.org/t/comparing-lxd-vs-lxc/24

它说,

lxd

lxd是LXD守护进程。为了与守护进程交互(例如,创建和管理容器),您需要使用lxc命令。通常不想直接调用lxd --除非您需要运行lxd init或其他什么东西;请查看man或lxd --帮助了解如何直接运行lxd,但是一旦从init系统运行了LXD,除非您正在调试lxd本身,否则可能不需要直接调用它。

lxc 命令是LXD前端(“LXD客户端”是我的看法)。

但是,如果您试图使用LXD,您应该避免使用以lxc开头的任何命令(这是lxc,后面跟着一个短的连字符)!这些命令与LXC相关联。

lxc

lxc命令以lxc- (即lxc,后跟一个短的连字符)开始。如果没有连字符,只有文字命令lxc,则与LXD.相关联。

票数 0
EN

Stack Overflow用户

发布于 2021-02-10 19:38:50

LXC和LXD都是Linux Containers.

  • LXC的同一个团队在LXD之前开发的。

  • 都是基于普通的liblxc库。

  • LXC是用C编写的,而LXD是在Go language.

  • LXD中编写的,它附带了一个管理程序(容器管理器),使得它对大多数用户更加友好。

如果您是一个新用户,并试图决定使用哪一个,请选择LXD。

参考资料:https://blog.simos.info/comparison-between-lxc-and-lxd/

票数 1
EN

Stack Overflow用户

发布于 2022-07-03 05:49:24

简单地说,'LXC‘是一个容器平台本身,由'lxc-*’工具管理,并提供非常基本的功能集。

相反,'LXD‘是建立在LXC基础上的编制工具。

同样,这是一个非常粗糙的类比,没有涵盖细微差别和细节。

如果您所需要的只是一小组持久的孤立容器(云实例、游戏服务器),能够对每个长期运行的实例的行为进行精细优化,那么LXC很可能就是您所需要的全部。

如果您想每天使用模板和自动化工具创建和销毁100个容器,请查看LXD。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63231239

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档