Struct dockerfile_parser::Stage
source · [−]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: usizeThe 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
sourceimpl<'a> Stage<'a>
impl<'a> Stage<'a>
sourcepub fn arg_index(&self, name: &str) -> Option<usize>
pub fn arg_index(&self, name: &str) -> Option<usize>
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
sourceimpl<'a> Ord for Stage<'a>
impl<'a> Ord for Stage<'a>
sourceimpl<'a> PartialOrd<Stage<'a>> for Stage<'a>
impl<'a> PartialOrd<Stage<'a>> for Stage<'a>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a> Eq for Stage<'a>
impl<'a> StructuralEq for Stage<'a>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more