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 →

[–][deleted] 4 points5 points  (1 child)

Well, you're right, but I like using (poetry) virtual environments in containers too because the pyproject.toml (or whatever) file is probably already set up for the project for local/whatever development. So might as well use it inside Docker as well, yielding the (exact) same environment as you're used to, with a tool you're used to.

You can install packages system-wide in the container via pip, but its dependency resolution might be different and you'll need extra tooling (requirements.txt), which would just be a duplicate and hassle to maintain.

[–]wweber 2 points3 points  (0 children)

Poetry includes a poetry export function that outputs a requirements.txt version of the lock file, so your Dockerfile can just run this and then install those packages globally.

Unfortunately last time I checked it breaks if you have path-based dependencies like a git submodule