6 ms·
Sorry to be this guy, but why is Nix better than a docker dev container?
by focom 3y ago
Sorry to be this guy, but why is Nix better than a docker dev container?
- OJFord 3y agoOn non-Linux it should be faster/less overhead; on all platforms I suppose it's just arguably easier/quicker to make changes & 'rebuild', and then the result is that that just is your environment, it's not a container inside it that you have to exec into or run commands through or make your IDE use or whatever. But mostly it's just two different approaches and people will be happy to argue about why there's is better, or that they don't use either (just the system environment (on a non-NixOS system..) as it were).
- ParetoOptimal 3y agoI mostly agree, but one big thing missing is Nix is reproducible by default while docker is only repeatable.
- OJFord 3y agoYeah, I was just trying to avoid anything to which you could say 'well I can do that with docker [and appropriate care & attention]'.
- tomberek 3y agoIt's not necessarily that one is better than another; it can be complementary. I tend to think that Nix makes many of the reasons to use a container superfluous, but there still remain other reasons to use containers. For example, a talk about using both Docker and Nix (yep, that's me ;) ): https://www.youtube.com/watch?v=l17oRkhgqHE https://www.youtube.com/watch?v=l17oRkhgqHE
- Rucadi 3y agoI have to use both at the same time. I have a Docker with an old version of centos which for some reason is the one provided to us. I then create an "overlay" over it using nix, so I can actually use software with newer glibc etc... easily. Regardless of that, nix is way better than docker, in the sense that docker doesn't ensure reproducibility, you can build a Dockerfile in two different days, and get different versions of packages installed, this is simply not possible with nix, you have complete control over your tools. And if you decide to port your application to a "nix package", you have complete control over all the dependencies of you application, a reproducible way to build it, and an easy way to deploy it.