I read some articles about using a virtual environment in Docker. Their argument are that the purpose of virtualization in Docker is to introduce isolation and limit conflicts with system packages etc.

However, aren’t Docker and Python-based images (e.g., python:*) already doing the same thing?

Can someone eli5 this whole thing?

  • uthredii@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    4 months ago

    If you do multi stage builds (example here) it is slightly easier to use venvs.

    If you use the global environment you need to hardcode the path to global packages. This path can change when base images are upgraded.