From e13b2991341c54efa1b0f7c68e107aae1e47e553 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Thu, 28 Oct 2021 05:09:03 +0200 Subject: [PATCH] nixos-container: add page (#7163) --- pages/linux/nixos-container.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/linux/nixos-container.md diff --git a/pages/linux/nixos-container.md b/pages/linux/nixos-container.md new file mode 100644 index 000000000..38c7395cf --- /dev/null +++ b/pages/linux/nixos-container.md @@ -0,0 +1,28 @@ +# nixos-container + +> Starts NixOS containers using Linux containers. +> More information: . + +- List running containers: + +`sudo nixos-container list` + +- Create a NixOS container with a specific configuration file: + +`sudo nixos-container create {{container_name}} --config-file {{nix_config_file_path}}` + +- Start, stop, terminate, or destroy a specific container: + +`sudo nixos-container {{start|stop|terminate|destroy|status}} {{container_name}}` + +- Run a command in a running container: + +`sudo nixos-container run {{container_name}} -- {{command}} {{command_arguments}}` + +- Update a container configuration: + +`sudo $EDITOR /var/lib/container/{{container_name}}/etc/nixos/configuration.nix && sudo nixos-container update {{container_name}}` + +- Enter an interactive shell session on an already-running container: + +`sudo nixos-container root-login {{container_name}}`