diff --git a/src/commands/create/custom_opts.rs b/src/commands/create/custom_opts.rs index 79bc455..46e1296 100644 --- a/src/commands/create/custom_opts.rs +++ b/src/commands/create/custom_opts.rs @@ -67,14 +67,20 @@ pub struct CustomOptions { impl CustomOptions { pub fn from_spec(spec: &oci_spec::runtime::Spec, env: RuntimeEnv) -> Result { - let args = spec + let mut args: Vec<&String> = spec .process() .as_ref() .unwrap() .args() .iter() .flatten() - .filter(|arg| !arg.trim().is_empty()); + .collect(); + + if let Some(&first_arg) = args.first() { + if first_arg.trim().is_empty() || first_arg == "no-entrypoint" { + args.remove(0); + } + } // TODO: We currently assume that no entrypoint is given (either by being set by in the // container image or through --entrypoint). Must somehow find whether the first arg is the diff --git a/tests/env.sh b/tests/env.sh index b13372e..fbcd1f4 100755 --- a/tests/env.sh +++ b/tests/env.sh @@ -237,8 +237,7 @@ start) --rm -dit \ -v "$temp_dir":/home/fedora/images:z \ -v "$repo_root/target":/home/fedora/target:z \ - "$env_image" \ - "" + "$env_image" # shellcheck disable=SC2317 __extra_cleanup() { diff --git a/util/package-vm-image.sh b/util/package-vm-image.sh index b614410..7ad0766 100755 --- a/util/package-vm-image.sh +++ b/util/package-vm-image.sh @@ -18,4 +18,5 @@ image_path_in_container=/disk/$( basename "${vm_image_file}" ) podman image build --file=- --tag="${container_image_tag}" / <