4 ms·
Thanks! We experienced that exact same pain. Whether it's pip or Bundler, I can't tell you how many times I've installed and reinstalled requirements. Sharing
by silvamerica 11y ago
Thanks!
We experienced that exact same pain. Whether it's pip or Bundler, I can't tell you how many times I've installed and reinstalled requirements.
Sharing data volumes is kind of a hack to make it really easy to keep part of a container around when you delete and recreate a container. I would love to see persistent data volumes become first class citizens so you don't have to create a separate container for them.
For now, though, it's saved us from having to put everything directly into the image in development.
- emailgregn 11y agoInstall 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.
- zenlikethat 11y agoYou'll be able to create volumes as first class citizens in the next Docker release with the new 'docker volumes' command if I'm not mistaken: https://github.com/docker/docker/blob/4b4597ae17d4fd8843aa9367fd1aa790cc74f7f6/api/client/volume.go#L25 https://github.com/docker/docker/blob/4b4597ae17d4fd8843aa93...
- silvamerica 11y agoYes, I'm looking forward to it! It will still be a little ways off before we can use it with Compose, however.