Live data from Hacker News

Will Nix Overtake Docker?

blog.replit.com

171–180 of 259 posts

Re: Will Nix Overtake Docker?

#171
post #165

Earlier quoted context omitted.

Maybe an apt comparison is git. It's just as easy to make a mistake with git today as it was however many years ago; git hasn't fundamentally changed in ways that make it easier. Git still more/less requires you to have a good understanding of what's going on in order to be comfortable using it. But, since use of git is now widespread, it's less of an issue. And the git CLI has seen some UX improvements. Nix is very…

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.

Re: Will Nix Overtake Docker?

#172

Earlier quoted context omitted.

> With Docker you leverage the existing packaging ecosystem like pip or apt. with import {}; runCommand "my-python-package" { buildInputs = [ pythonPackages.pip ]; } '' cd ${/my/project/dir} pip install ''

That compared to `RUN pip install ` is probably one of the things people are complaining about, no?

I think the complaint is about things like:

    (import  {}).pythonPackages.callPackage
      ({ buildPythonPackage, dep1, dep2, dep3, pip }: buildPythonPackage {
        pname                 = "my-package";
        version               = "123";
        propagatedBuildInputs = [ dep1 dep2 dep3 ];
        doCheck               = true;
        src                   = /my/package/dir;
      })
      {}
That's how Nixpkgs tends to do things, which has nice features like building each dependency separately, allowing easy overrides, etc. but it requires knowledge of how Nixpkgs orchestrates its Python packages.

In contrast, 'runCommand' lets us just run a shell script like 'pip install', which is easier but doesn't have those niceties. Also, depending on the platform, the Nix sandbox may have to be disabled for 'pip install' to work, since Nix tries to prevent network access (I think it's enabled by default on Linux, but not on macOS)

Re: Will Nix Overtake Docker?

#174
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…

Was/would it be hard to switch back to traditional containers or was there some kind of lock-in effect? Or was the consensus just pro-Nix?

The conesnsus with those who mattered to make that change was pro-Nix, but I have no idea how you'd go back to containers because by that point builds were declarative and the implementation was spread over abstractions and repositories! So if DevOps decided to quit because another company was using SuperNix2, which I think is a plausible thing if you have a team using a risky technology, then it would have required hiring consultants to do it - I think it would have been a months-long refactor going in blind.

Re: Will Nix Overtake Docker?

#175
post #50

Earlier quoted context omitted.

Thanks, this is the one! Highly recommend it, especially when you're in the HN echo chamber of new and interesting technologies

Worth noting in this context of OP, though, is that Nix predates Docker by about a decade.

Huh, cool! This is like Python being older than Java :mindblown:. Still, old technologies can be just as risky as new ones.

Re: Will Nix Overtake Docker?

#176

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…

> I get that nix is supposed to be hermetic, but does it enable two of something? No, it doesn't solve the TCP port isolation problem. (But Docker doesn't really either. Linux network namespaces should, but nobody bothered to develop tools for that yet.)

Doesn't docker-compose set up a private network interface?

Re: Will Nix Overtake Docker?

#177
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…

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 highly available and scales by itself?

With containers I just put it in kubernetes.

Re: Will Nix Overtake Docker?

#178
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…

I'd say don't blame the tool for what sounds like an architectural mess.

TFA points out using nix as a reproducible build environment - which it is excellent at. Create a shell.nix in your repo, and every dev uses the same exact tools within the comfort of their own machine/shell. Docker is much more painful for this kind of local dev workflow.

Re: Will Nix Overtake Docker?

#179
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"

More like developer Towers of Babel waiting to collapse on every build attempt. Docker is fine if it's used correctly but it does add a layer of complexity, it doesn't abstract it away..

The way I see it rampantly (ab)used is as a shortcut to get some software up and running by leveraging a public image and passing tech debt for some component of one's system onto the maintainer of the Docker image, then cobbling together multistage builds from those and microservice architectures to try and support this tech debt model. Sometimes it works, many times it breaks, often it turns into complete and utter nightmares to deal with.

"Amazing Andy got this fantastically complex system up and running in a week all by their self way under time and budget and it works. Now I just want to add this feature or modify this one thing and you're telling me that's going to take how long?" Yea, I've seen this more times than I care to admit.

Re: Will Nix Overtake Docker?

#180
post #31
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…

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.
Post reply on HN