Reputation: 31642
I have seen many examples of dockerfiles with conda commands in them. And there are pre-build anaconda and miniconda containers. I must be missing something.
Doesn't docker REPLACE virtualenv and conda? Shouldn't I have all of my dependencies right in my dockerfile? I don't understand what I gain from adding anaconda here. In fact it seems like it makes my container unnecessarily bigger if I have to pull a miniconda container if Im not using all of miniconda's included modules.
Upvotes: 21
Views: 10159
Reputation: 403
Docker does not replace anything. It is simply one way to do things.
No, you should not have all of your dependencies right in your Dockerfile. I, for one, will be running pip install
from a virtualenv without ever touching Docker/*conda unless I have a good reason. Your lack of requirements.txt is not a good reason :)
Conda came out in 2012 - well before Docker. Since Python has such a strong following in the non-programmer community, I rarely expect intelligible code, much less some type of DevOps ability. Conda was the perfect solution for this group.
With Docker, you can have a functional Docker environment with FROM python:xx
, COPY . /workdir
, and RUN pip install -r requirements.txt
(supposing you're using that file *ahem), but your developers will probably need a volume so they can work (so they need to know --volume
. Also, if you're running Django you'll need ports configured (now they need --port
and you need EXPOSE
). Oh, also Django might need a database. Now you need another container and you're writing a docker-compose file.
But consider the following, from almost all of my professional (DevOps) experience IF you just include requirements.txt-
HTH - don't get too locked in to one piece of technology!
Upvotes: 13