Live data from Hacker News

Will Nix Overtake Docker?

blog.replit.com

181–190 of 259 posts

Re: Will Nix Overtake Docker?

#181

Earlier quoted context omitted.

This mirrors my experience as a developer in an org that used Nix. If you want the dev team to have a strong dependency on the devops team for every little (often unpredictable) aspect of their workflow, Nix is the tool for the job. Don’t get me wrong, I’m completely bought in on the vision of reproducible builds but there’s a long ways to go before it’s usable in real organizations. I’ve heard that some orgs manage…

> If you want the dev team to have a strong dependency on the devops team for every little (often unpredictable) aspect of their workflow, I have never used nix, but from the article the author only concentrated on the fact that docker and nix create reproducible environments, and completely misses the other benefits of containers. As a devops guy if someone hands me a nix project, how do I deploy that so it is highl…

You can use Nix as a better docker build, see https://grahamc.com/blog/nix-and-layered-docker-images or https://nixery.dev/.

Re: Will Nix Overtake Docker?

#182
post #31

Earlier quoted context omitted.

Funny, because I feel that simple tasks that would take minutes in my machine are now a dev adventure with docker. And I mean funny. I suspect it is different mindsets. And I personally like that both seem to be thriving.

It's well documented that Docker and especially docker hub had a terrible impact on security. Once you factor in the efforts required in the long term to mitigate a decade of bundling gigabytes of applications and libraries it's a huge "dev adventure"

Just build your own images like you would otherwise install the software on bare metal. Base those images on official images, not community images.

Re: Will Nix Overtake Docker?

#183
post #171
post #165

Earlier quoted context omitted.

I avoid most git usability issues by using it as SVN. When something goes wrong I just bork the whole repo and clone it again, then manually merge the last set of saved changes.

Thank you! Me too. I can finally come out of the closet.

I has been a long journey since I started with RCS back in 1998, but given that git now is everywhere, the least I deal with its complexity the better.

In some bad days I even miss Clearcase.

Re: Will Nix Overtake Docker?

#184
post #182

Earlier quoted context omitted.

It's well documented that Docker and especially docker hub had a terrible impact on security. Once you factor in the efforts required in the long term to mitigate a decade of bundling gigabytes of applications and libraries it's a huge "dev adventure"

Just build your own images like you would otherwise install the software on bare metal. Base those images on official images, not community images.

YMMV.

Personally, you would have to pry my Bitnami images out of my cold dead hands.. there is just no way my team of 2 can do anywhere near as good.

Re: Will Nix Overtake Docker?

#185
post #180
post #31

Earlier quoted context omitted.

Funny, because I feel that simple tasks that would take minutes in my machine are now a dev adventure with docker. And I mean funny. I suspect it is different mindsets. And I personally like that both seem to be thriving.

If you can do it in minutes on your machine, you can spend those minutes updating your Dockerfile to automate the steps instead. It's essentially the same thing.

Unless auth is concerned. There are loads of tools I run that I want to just be me. Not whatever user is configured in the image.

And learning how to manage that mapping was a heck of a time sink.

Re: Will Nix Overtake Docker?

#186

Earlier quoted context omitted.

I don't understand how these are comparable. I also don't understand what you mean by "bindings". Do you mean writing nix derivations for new packages? I would much rather do that than fiddle with Debian packaging. Or do you mean writing nix modules to configure a service? There are certainly some (IMO) over engineered nixos modules, but there are also some dead simple ones.

> I don't understand how these are comparable They fulfill similar business functions - allowing you to run the same code on a bunch of dev machines and on prod (modulo modifications for e.g. database storage in Docker's case). Nix people get hung up on the fact that Docker runs containers, but it doesn't really matter that much. Often Docker is the shortest path to getting software running on multiple machines repro…

> and if there are conflicts between dependencies of the services they can go into different containers. Getting the benefit of Nix - reproducibility - without the extra effort

To be clear, are you suggesting that

    RUN sudo apt-get update && sudo apt-get -y install ...
is somehow reproducible? I'm asking because I was surprised to see the above as being described as "reproducible" of all things. Splitting that into many different containers would likely exacerbate the reproducibility problem instead of improving it.

> With Docker you leverage the existing packaging ecosystem like pip or apt. The packages are already written for you

This is even more true for Nix, which has the largest and most up-to-date package repositories out there[1]. Plus, with Nix, you can easily make a new package based on existing packages with a mere few lines of code if the existing packages doesn't fit your needs. Other package managers besides Guix doesn't offer you that flexibility so you'd have to compile from scratch. That's way more tedious, hard to maintain, and definitely not reproducible.

[1]: https://repology.org/repositories/graphs

Re: Will Nix Overtake Docker?

#188

IMO initial value of docker for local development is enabling me to run two copies of postgres without them shitting on each other. I get that nix is supposed to be hermetic, but does it enable two of something? nix being really good at package management is something docker needs to imitate -- out of order apt-get without requiring a re-downloading all the packages, for example, seems like it would shrink most cloud…

You can use Nix to create a tarball that can then be launched as a Docker container. However, I haven’t figured out a way to make Nix play nicely with container image layering—you get a small container image for deployment, but you’ll have lots of such largely-duplicative tarballs in the CI pipeline and the latency for generating them is annoying.

I do this, but I don't use Docker; I just create a .tar.gz file for each layer, run them through the `sha256sum` command to get a digest, and generate a JSON config file (via builtins.toJSON). The result can be run by anything that supports OCI containers (e.g. AWS ECS).

Re: Will Nix Overtake Docker?

#189
post #91

As TFA itself answers, "no". But I can give a different reason: nix is too much of a barrier of entry, relative to Docker. Docker might not be simple ; there's a lot of moving parts to manage, some hidden gotchas, and networks are a mess. But it's comparatively easy , and once you bake an image, it's pretty simple . Dockerfiles are basically just sh. Package managers are the usual suspects. Images are easy to distrib…

I agree, there’s a reason no one uses Nix. It has terrible DX

Quite a few people use Nix.

Re: Will Nix Overtake Docker?

#190
post #29

Oh god I hope not. Having worked in > 100kloc nix environments I am completely turned off of the idea. I really really tried, I installed NixOS as my main OS and used Nix whenever I could to try and pick it up, but it's such a complex beast I felt it slowed everything down. Simple tasks that would take 10 minutes in Docker suddenly became DevOps tickets. I suddenly had to write bindings for tools rather than apt-get…

Right, they're hiding complexity. If you look at my recent comments in a related thread - everyone was arguing against me for even attempting to compare Nix and Docker ("you're comparing things that aren't meant to be compared" basically). Now those same people are commenting in this thread in favor of Nix as a solution. Such dishonesty & delusion!
Post reply on HN