Build only up to a named stage.
Section: Build Flags and Targets
Build a specific stage
bash
bash
docker build --target build -t myapp:build .Explanation
Useful for debugging or exporting builder-only images.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Build Flags and Targets
Always pull newer base image
Attempt to pull a newer base image before build.
Build from Dockerfile
Build an image from the Dockerfile in the current directory.