Struct dockerfile_parser::Stages [−][src]
Expand description
A collection of stages in a [multi-stage build].
Example
use dockerfile_parser::Dockerfile;
let dockerfile = Dockerfile::parse(r#"
FROM alpine:3.12 as build
RUN echo "hello world" > /foo
FROM ubuntu:18.04
COPY --from=0 /foo /foo
"#).unwrap();
for stage in dockerfile.stages() {
println!("stage #{}, name: {:?}", stage.index, stage.name)
}
Fields
stages: Vec<Stage<'a>>
Implementations
Attempts to fetch a stage by its name (FROM
alias).
Attempts to fetch a stage by its string representation.
Stages with a valid integer value are retrieved by index, otherwise by name.