Docker CLI

docker build --target

Selects the stage exported by the build. BuildKit may skip unrelated stages. An independent check target needs an enforced workflow. A fresh check can bypass cache; enforce success on the same inputs before promotion.

Formal Syntax & Structure

docker syntaxdocker
docker build --target <stage> [OPTIONS] PATH

Parameters & Attributes

NameTypeDescription
stagestringDeclared target name.
PATHstringReviewed local context.

Working Example

Example Snippetdocker
docker build --no-cache --load --network none --target checks -t bm-v10-checks:lab .
Docker Reference