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

This commit is contained in:
Alex Zenla 2024-02-25 00:09:33 +00:00
parent 6511f2f0fa
commit b30c785817
No known key found for this signature in database
GPG Key ID: 067B238899B51269

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(),