container: fix bug where argv[0] was not set properly

This commit is contained in:
alex committed 2024-02-25 00:09:33 +00:00
1 parent 6511f2f0fa
commit b30c785817
1 file changed
+4 -1
+4 -1
View File
@@ -380,7 +380,10 @@ impl ContainerInit {
cmd.push("/bin/sh".to_string());
}
let path = cmd.remove(0);
let path = cmd
.first()
.ok_or_else(|| anyhow!("command is empty"))?
.clone();
let mut env = match config.env() {
None => vec![],
Some(value) => value.clone(),