fn extract_image()

in enclave_build/src/docker.rs [268:285]


    fn extract_image(&self) -> Result<(Vec<String>, Vec<String>), DockerError> {
        // First try to find CMD parameters (together with potential ENV bindings)
        let image = self.inspect()?;
        let config = image.config.ok_or(DockerError::UnsupportedEntryPoint)?;

        if let Some(cmd) = &config.cmd {
            let env = config.env.unwrap_or_default();
            return Ok((cmd.clone(), env));
        }

        // If no CMD instructions are found, try to locate an ENTRYPOINT command
        if let Some(entrypoint) = &config.entrypoint {
            let env = config.env.unwrap_or_default();
            return Ok((entrypoint.clone(), env));
        }

        Err(DockerError::UnsupportedEntryPoint)
    }