8 ms·
Install each of the pip/bundler requirements with a separate dockerfile RUN command. Each gets cached into its own container filesystem layer that way and only
by emailgregn 11y ago
Install each of the pip/bundler requirements with a separate dockerfile RUN command. Each gets cached into its own container filesystem layer that way and only new requirements are pulled. Use your favourite templating tool to generate the dockerfile with multiple run commands.
I wrote djtempl ( https://github.com/emailgregn/djtempl https://github.com/emailgregn/djtempl ) for my purposes.
- davexunit 11y agoBut let's say a dependency is changed. Won't modifying that RUN directive invalidate the cache for everything after it, potentially rebuilding a ton of stuff anyway?
- emailgregn 11y agoYup, that's the trade-off.
- davexunit 11y agoIt's unfortunate that Docker uses an imperative model. A functional model would have much better cache utilization.