Skip to main content

run

Function run 

Source
pub fn run(
    engine: &Engine,
    target: &Target,
    image: &str,
    program: &str,
    args: &[String],
) -> Result<i32, String>
Expand description

Runs program with args in image under the profile for target and returns its exit status (128 if it was killed by a signal).

The current directory, and program if it is a host path outside it, are mounted at their own absolute paths so relative paths and compile-time CARGO_MANIFEST_DIR values keep working. A bare program name (no /) runs from the image. A host program is mounted as a single file, never its directory, which could hide the image’s own /bin or /usr/bin. CARGO*/RUST* variables are forwarded. Suitable for a Cargo runner.