← All notes

Docker multi-stage builds

Answer: With multi-stage builds, you use multiple FROM statements in your Dockerfile. Each FROM instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don't want in the final image. (S1)

What it buys you

Naming and sharing stages

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker Docs, Multi-stage builds, Docker docs, Apache-2.0 (github.com/docker/docs; https://github.com/docker/docs/blob/main/LICENSE); Docker name and logo are trademarks of Docker Inc and are not licensed; Docker Docs, Building best practices, Docker docs, Apache-2.0 (github.com/docker/docs; https://github.com/docker/docs/blob/main/LICENSE); Docker name and logo are trademarks of Docker Inc and are not licensed.

Cite this

Permanent ID: iil:note:mdfrayrz

iinventedlight. 2026. "Docker multi-stage builds." iinventedlight Library, iil:note:mdfrayrz, version of 2026-11-04. https://iinventedlight.com/library/notes/docker-multi-stage-builds/. License: CC-BY-4.0.

@misc{iil_note_mdfrayrz,
  author = {{iinventedlight}},
  title = {{Docker multi-stage builds}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/docker-multi-stage-builds/},
  note = {Permanent ID iil:note:mdfrayrz. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/docker-multi-stage-builds.md.