Hacker News new | past | comments | ask | show | jobs | submit login

Honest question: is uv more reproducible/portable than cramming your Python project into a Docker container? I've used pyenv, pip, venv, and a couple of other things, and they all work fine, at first, in simple scenarios.



Docker isn't a project manager, I'm struggling to see the comparison. If you have an app (api/web etc) you would use uv to manage dependencies, lock files and a locam virtual environment for development, and then you could install the same dependencies and the project in a docker image also for deployment.


People certainly use Docker for this purpose. Need a new package? Add a pip install line and rebuild the image.

I agree it isn’t the best use of Docker, but with the hell that is conda (and I say this as someone who likes conda more than most other options) and what can feel like insanity managing python environments, Docker isn’t the worst solution.

All that said, I moved to uv last year and have been loving it.


Yeah, I also used Docker (actually, Podman) as an alternative Python package manager and it worked well enough. Most of all, it felt somewhat cleaner and more reproducible than using plain virtualenv.

Of course, I migrated from it after I learned uv.


> Honest question: is uv more reproducible/portable than cramming your Python project into a Docker container?

Yes (unless you use uv in your Dockerfile). I mean, a Docker container will freeze one set of dependencies, but as soon as you change one dependency you've got to run your Dockerfile again and will end up with completely different versions of all your transitive dependencies.


People used pip-tools for this prior to uv (uv also replaces pip-tools).


I've literally never heard of that until just now, and I've heard of a lot of Python packaging tools.


As SRE with a ton of python stuff, nothing has beat Dev Containers with VSCode for not losing my mind with Python.

For running containers, pip is best way to go just to keep dependency requirements to minimum.


I've seen a lot of docker images move to uv inside their docker file.

Use both.


It’s less reproducible than docker (assuming the pip usage is correct). Docker specifies a lot of OS properties that UV ignores.

That being said, UV is great.


even if you go through the hassle of using docker for your local dev environment, you still need something to install dependencies in a reproducible way when you rebuild the image.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: