For a lot of good general information on these subjects, I recommend Glyph's talk at pycon this year:
  https://www.youtube.com/watch?v=5BqAeN-F9Qs

One point that's discussed is why you definitely should use virtualenv inside your containers :-)

-n

On Jun 15, 2016 2:07 AM, "Reinout van Rees" <reinout@vanrees.org> wrote:
Hi,

Buzzword bingo in the subject...

Situation: I'm experimenting with docker, mostly in combination with buildout. But it also applies to pip/virtualenv.

I build a docker container with a Dockerfile: install some .deb packages, add the current directory as /code/, run buildout (or pip), ready. Works fine.

Now local development: it is normal to mount the current directory as /code/, so that now is overlayed over the originally-added-to-the-docker /code/.



This means that anything done inside /code/ is effectively discarded in development. So a "bin/buildout" run has to be done again, because the bin/, parts/, eggs/ etc directories are gone.

Same problem with a virtualenv. *Not* though when you run pip directly and let it install packages globally! Those are installed outside of /code in /usr/local/somewhere.



A comment and a question:

- Comment: "everybody" uses virtualenv, but be aware that it is apparently normal *not* to use virtualenv when building dockers.

- Question: buildout, like virtualenv+pip, installs everything in the current directory. Would an option to install it globally instead make sense? I don't know if it is possible.




Reinout

--
Reinout van Rees                          http://reinout.vanrees.org/
reinout@vanrees.org                   http://www.nelen-schuurmans.nl/
"Learning history by destroying artifacts is a time-honored atrocity"

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig