4 ms·
Production-ready Docker Containers with uv
- deleted 2y ago[deleted]
- greener_grass 2y agoI thought UV would help remove the need for Docker?
- sundbry 2y agoYeah this would be great if it had a feature like jib (https://github.com/GoogleContainerTools/jib https://github.com/GoogleContainerTools/jib) where it just natively packages into a container. It seems like it should have all the information it needs to work, as long as you can override the base image.
- timeon 2y agoThat is what Rye is for.
- hynek 2y agoThat is inaccurate. Both Rye and uv have the same goals and support virtualenvs. uv is meant to supplant Rye eventually (it mostly already has: see also this post by the creator of Rye: <https://lucumr.pocoo.org/2024/8/21/harvest-season/ https://lucumr.pocoo.org/2024/8/21/harvest-season/>). But you can’t put a virtualenv into a Kubernetes, so Docker containers are still interesting if that’s something you want to do.
- ssahoo 2y agoWhat is the benefit of using uv over pip if it's inside a container? Pythons virtual environment is not enough?
- mousekrup 2y agohttps://developers.home-assistant.io/blog/2024/04/03/build-images-with-uv/ https://developers.home-assistant.io/blog/2024/04/03/build-i...
- hynek 2y agoIt’s much, much faster both in creating virtualenvs and installing the dependencies. And if you use lock/sync, you get a cross-platform lockfile that you only got with PDM and Poetry before – no more requirements.txt (but it supports it too).
- greener_grass 2y agoWhy was UV created when we already have PDM and Poetry? Genuine question, we are drowning in options here!
- hynek 2y agoBoth PDM and Poetry are a) 90% solutions that only cover what their respective authors need (and this is indeed what Python is drowning in) and b) written in Python which makes them slow and somewhat janky since Python installations and virtualenvs tend to break (lol Homebrew). I personally love PDM, and PDM is in the process of adopting uv’s lower-leveln functionality to install/resolve packages, but I can see how having a single binary for bootstrapping a whole dev environment is really nice. In the end, uv’s biggest upside is that it has several people work 8h / day on it and one would be surprised how much can be achieved in such amount of time.
- dmd 2y agoBuilding my container takes 17 minutes with pip and 3 with uv.