mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
systemd-nspawn: add page (#11398)
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> Co-authored-by: Shashank Hebbar <shashankhebbarm@gmail.com>
This commit is contained in:
parent
5c26174aa9
commit
c91fd38d59
1 changed files with 20 additions and 0 deletions
20
pages/linux/systemd-nspawn.md
Normal file
20
pages/linux/systemd-nspawn.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# systemd-nspawn
|
||||
|
||||
> Spawn a command or OS in a lightweight container.
|
||||
> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemd-nspawn.html>.
|
||||
|
||||
- Run a command in a container:
|
||||
|
||||
`systemd-nspawn --directory {{path/to/container_root}}`
|
||||
|
||||
- Run a full Linux-based OS in a container:
|
||||
|
||||
`systemd-nspawn --boot --directory {{path/to/container_root}}`
|
||||
|
||||
- Run the specified command as PID 2 in the container (as opposed to PID 1) using a stub init process:
|
||||
|
||||
`systemd-nspawn --directory {{path/to/container_root}} --as-pid2`
|
||||
|
||||
- Specify the machine name and hostname:
|
||||
|
||||
`systemd-nspawn --machine={{container_name}} --hostname={{container_host}} --directory {{path/to/container_root}}`
|
Loading…
Add table
Reference in a new issue