Need Assistance?

support@tutorialshub.in

Building Production Images

Build Cache and Layering

ADVERTISEMENT
Docker Free Lesson
5 min read
ADVERTISEMENT

Designing for Fast Builds

Docker builds can reuse cached layers when the instruction and its inputs have not changed. Put stable dependency manifests before frequently changing source files.

For example, copy package.json and the lockfile, install dependencies, then copy application source. A source-only change can then reuse the dependency layer.

ADVERTISEMENT