tldr/pages/linux/lxc.md

38 lines
908 B
Markdown
Raw Normal View History

2017-05-16 06:12:11 +01:00
# lxc
> Manage Linux containers using the lxd REST API.
> Any container names or patterns can be prefixed with the name of a remote server.
> More information: <https://manned.org/lxc>.
2017-05-16 06:12:11 +01:00
- List local containers matching a string. Omit the string to list all local containers:
`lxc list {{match_string}}`
- List images matching a string. Omit the string to list all images:
`lxc image list [{{remote}}:]{{match_string}}`
- Create a new container from an image:
2019-09-27 18:25:38 +01:00
`lxc init [{{remote}}:]{{image}} {{container}}`
2017-05-16 06:12:11 +01:00
- Start a container:
`lxc start [{{remote}}:]{{container}}`
- Stop a container:
`lxc stop [{{remote}}:]{{container}}`
- Show detailed info about a container:
`lxc info [{{remote}}:]{{container}}`
- Take a snapshot of a container:
`lxc snapshot [{{remote}}:]{{container}} {{snapshot}}`
2022-09-12 02:29:21 +01:00
- Execute a specific command inside a container:
`lxc exec [{{remote}}:]{{container}} {{command}}`