Get the latest tech news

I Still Use Python Virtual Environments in Docker


Whenever I publish something about my Python Docker workflows, I invariably get challenged about whether it makes sense to use virtual environments in Docker containers. As always, it’s a trade-off, and I err on the side of standards and predictability.

As an overarching theme, my goal is not to mindlessly follow some ~best practices~ that add complexity for questionable payoffs because a big tech developer advocate said so at a conference. If I had a dime for every time someone yelled at me on a bug tracker caused by weird stuff in their user-local Python packages, I wouldn’t have to beg for sponsorships. They introduce complications like using pip install --user(which is semantically odd in Docker and was never meant to be used for something like this) and may require unfamiliar tools and paradigms compared to what you’re using in development.​​​​​​​​​​​​​​​​

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Docker

Docker

Related news:

News photo

OrbStack: The fast, light, and easy way to run Docker containers and Linux

News photo

Pi-CI – A RasPi 5 emulator in a Docker image for creating and flashing configs

News photo

Show HN: Isaiah – open-source and self-hosted app to manage everything Docker