Skip to main content

validate_dockerfile

Function validate_dockerfile 

Source
pub fn validate_dockerfile(dockerfile: &Dockerfile) -> Result<(), DepsError>
Expand description

Walk every stage in dockerfile and error if any RUN on a nanoserver-based stage uses choco or winget.

Non-Windows base images (Linux, scratch, other stage refs) and servercore bases are skipped — they either don’t apply or are capable of running the package managers in question.

§Errors

Returns DepsError::ChocoOnNanoserver on the first offending RUN instruction encountered. First-match-wins: we do not accumulate multiple errors because fixing the first one usually reveals the rest.