DevOps · Concept
multi-stage build
Multi-stage builds split a Dockerfile into separate stages. Build in one stage, then copy only runtime files into the final stage to keep the image smaller.
Last updated
Syntax
FROM <base-image> AS <stage-name>
COPY --from=<stage-name> <source> <destination>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Dockerfile best practicesBuildKitCOPYFROMbuild targets