build target
The named stage of a multi-stage Dockerfile you ask docker build to stop at.
In more detail
docker build --target test . builds up to the stage named test, for example to run tests in CI, while a normal build produces the final stage. One Dockerfile can then serve development, testing and production.
Example
docker build --target test -t taskapi:test .Related terms
- multi-stage build — A Dockerfile with several FROM stages, where later stages copy only what they need from earlier ones.
- docker build — The command that builds an image from a Dockerfile and a build context.
Related guides
Taught in
- Debugging Applications In Kubernetes — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Observability: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- CMD, ENTRYPOINT, USER And Process Signals — Docker Architecture & Production Containers
- Multi Stage Builds, Targets And Build Secrets — Docker Architecture & Production Containers