Struct dockerfile_parser::Stage[][src]

pub struct Stage<'a> {
    pub index: usize,
    pub name: Option<String>,
    pub instructions: Vec<&'a Instruction>,
    pub parent: StageParent<'a>,
    pub root: StageParent<'a>,
}
Expand description

A single stage in a multi-stage build.

A stage begins with (and includes) a FROM instruction and continues until (but does not include) the next FROM instruction, if any.

Stages have an index and an optional alias. Later COPY --from=$index [...] instructions may copy files between unnamed build stages. The alias, if defined in this stage’s FROM instruction, may be used as well.

Note that instructions in a Dockerfile before the first FROM are not included in the first stage’s list of instructions.

Fields

index: usize

The stage index.

name: Option<String>

The stage’s FROM alias, if any.

instructions: Vec<&'a Instruction>

An ordered list of instructions in this stage.

parent: StageParent<'a>

The direct parent of this stage.

If this is the first stage, it will be equal to the root stage.

root: StageParent<'a>

The root image of this stage, either an external reference (possibly from a remote registry) or scratch.

Implementations

Finds the index, relative to this stage, of an ARG instruction defining the given name. Per the Dockerfile spec, only instructions following the ARG definition in a particular stage will have the value in scope, even if it was a defined globally or in a previous stage.

Trait Implementations

Formats the value using the given formatter. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.