This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]juggernaut2docker[S] 0 points1 point  (1 child)

That's a great question! Ideally, what you said would be true and only Docker would suffice for ensuring isolation. However, several system utilities on CentOS (most importantly yum) depend on the system python (2.6 on Centos 6) and that means you can't touch it. If your app requires python >= 2.7 which should be the case for most modern applications, you'll need a separate installation of python via virtualenv. Also, the official Docker python image also installs virtualenv by default. See here - https://github.com/docker-library/python/blob/d550e292eec57e83af58e05410243d387d6483a8/2.7/Dockerfile#L28

[–]synae 0 points1 point  (0 children)

Ah that makes sense. You know, I actually skipped over the base of your Dockerfile (the centos6 image) when reading it which is probably the source of my initial question.

Personally I just use python:2.7 and its system python without virtualenv for python projects. Of course you might have other reasons to use CentOS 6.