liboci_cli/
run.rs

1use std::path::PathBuf;
2
3use clap::Parser;
4
5/// Create a container and immediately start it
6#[derive(Parser, Debug)]
7pub struct Run {
8    /// Path to the bundle directory, containing config.json and root filesystem
9    #[clap(short, long, default_value = ".")]
10    pub bundle: PathBuf,
11    /// Unix socket (file) path , which will receive file descriptor of the writing end of the pseudoterminal
12    #[clap(short, long)]
13    pub console_socket: Option<PathBuf>,
14    /// File to write pid of the container created
15    // note that in the end, container is just another process
16    #[clap(short, long)]
17    pub pid_file: Option<PathBuf>,
18    /// Disable the use of the subreaper used to reap reparented processes
19    #[clap(long)]
20    pub no_subreaper: bool,
21    /// Do not use pivot root to jail process inside rootfs
22    #[clap(long)]
23    pub no_pivot: bool,
24    /// Do not create a new session keyring for the container. This will cause the container to inherit the calling processes session key.
25    #[clap(long)]
26    pub no_new_keyring: bool,
27    /// Pass N additional file descriptors to the container (stdio + $LISTEN_FDS + N in total)
28    #[clap(long, default_value = "0")]
29    pub preserve_fds: i32,
30    // Keep container's state directory and cgroup
31    #[clap(long)]
32    pub keep: bool,
33    /// name of the container instance to be started
34    #[clap(value_parser = clap::builder::NonEmptyStringValueParser::new(), required = true)]
35    pub container_id: String,
36    /// Detach from the container process
37    #[clap(short, long)]
38    pub detach: bool,
39}