News for hackers. Stuff that matters.
Re:Developing with Docker at IFTTT by bndw on Wednesday October 07, 2015 @12:44PM (#10347072)
Nice to see a post that covers the various aspects of using Docker in place of some like Vagrant for local development.

The biggest pain I've run into when using Docker for local dev is waiting for pip to install dependencies on rebuilds. This offers an interesting strategy for mitigating that and I look forward to digging into this more.

Re:Developing with Docker at IFTTT by silvamerica on Wednesday October 07, 2015 @01:06PM (#10347269)
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.

Re:Developing with Docker at IFTTT by zenlikethat on Wednesday October 07, 2015 @06:00PM (#10349426)
You'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/4b4597ae17d4fd8843aa93...
Re:Developing with Docker at IFTTT by silvamerica on Wednesday October 07, 2015 @06:54PM (#10349706)
Yes, I'm looking forward to it! It will still be a little ways off before we can use it with Compose, however.
Re:Developing with Docker at IFTTT by emailgregn on Wednesday October 07, 2015 @03:38PM (#10348473)
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 ) for my purposes.

Re:Developing with Docker at IFTTT by davexunit on Wednesday October 07, 2015 @03:41PM (#10348487)
But 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?
Re:Developing with Docker at IFTTT by emailgregn on Wednesday October 07, 2015 @03:51PM (#10348553)
Yup, that's the trade-off.
Re:Developing with Docker at IFTTT by davexunit on Wednesday October 07, 2015 @04:01PM (#10348615)
It's unfortunate that Docker uses an imperative model. A functional model would have much better cache utilization.
Re:Developing with Docker at IFTTT by zenlikethat on Wednesday October 07, 2015 @06:01PM (#10349435)
I'm not sure if this address your specific pain point, but if your issue is around building images, if you first COPY requirements.txt and then do `pip install` before COPYing the rest of your code into the image, Docker caching will actually cache that layer for you.