[][src]Struct dockerfile_parser::Stage

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

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

impl<'a> Stage<'a>[src]

pub fn arg_index(&self, name: &str) -> Option<usize>[src]

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

impl<'a> Debug for Stage<'a>[src]

impl<'a> Eq for Stage<'a>[src]

impl<'a> Ord for Stage<'a>[src]

impl<'a> PartialEq<Stage<'a>> for Stage<'a>[src]

impl<'a> PartialOrd<Stage<'a>> for Stage<'a>[src]

impl<'a> StructuralEq for Stage<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Stage<'a>

impl<'a> Send for Stage<'a>

impl<'a> Sync for Stage<'a>

impl<'a> Unpin for Stage<'a>

impl<'a> UnwindSafe for Stage<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.