Builds the
build stage and only the stages it depends on, then stops--target stops at the named stage. BuildKit (Docker's modern builder) skips any stage that the target does not depend on. So it builds build and the stages it needs, and it does not build test or the final stage.
The old legacy builder processed all stages up to the target. That is why many people believe "Builds every stage, then tags the build stage". With BuildKit, that is wrong.
Read more