gpt4 book ai didi

lxc - lxc 命令 lxc start 和 lxc-start 等有什么区别?

转载 作者:行者123 更新时间:2023-12-05 06:13:39 27 4
gpt4 key购买 nike

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

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

$ 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

$ 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

最佳答案

  1. LXC 和 LXD 都是 Linux 容器的实现。
  2. LXC 和 LXD 是相关的,都是由同一团队开发的 https://linuxcontainers.org/
  3. LXC 早于 LXD。
  4. 两者都基于通用的 liblxc 库。
  5. LXC 是用 C 语言编写的,而 LXD 是用 Go 语言编写的。
  6. LXD 带有一个hypervisor(容器管理器),这使得它对大多数用户来说更加友好。

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

引用文献:https://blog.simos.info/comparison-between-lxc-and-lxd/

关于lxc - lxc 命令 lxc start 和 lxc-start 等有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63231239/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com