Last week, a new version of pip (the standard package manager for Python) was released. One big new feature, is the automatic caching of built packages (“wheels”). Here’s a good post on the feature.
Ideally, with Docker and pip 7, you could have a single cache, available at build time. This would offer a significant speed-up for repeated builds, or building multiple images that have overlapping Python dependencies.
I imagine that would look something like:
docker build . -v /my/pipcache:~root/.pip/cache
If the directory isn’t mounted, no big deal, the image still gets built. But, you could take advantage of a cache on the host system.
But, docker build doesn’t support built-time volumes.