Live data from Hacker News

Will Nix Overtake Docker?

blog.replit.com

101–110 of 259 posts

Re: Will Nix Overtake Docker?

#101

Somewhat not related and likely dumb question but I figure folks looking at this article can help steer me in the right direction: if I want containers to act like Linux VMs what's the best option? Like Docker minus the assumption that I only want a few specific directories to persist or the idea I'm interested in layering containers in a way that lets me reproduce building them. Like if I just want another separate…

In addition to systemd-nspawn, Kata Containers might also work for you: https://katacontainers.io/

Re: Will Nix Overtake Docker?

#102
post #84
post #73

Earlier quoted context omitted.

Does Nix understand network namespacing? Or would 2 postgres instances clash over tcp listen ports? I get you could configure different ports, or virtual interfaces, but it sounds like either of those would be outside of the nix tooling.

I don't think it would be possible to do this in an OS-agnostic way. LXC and jails are too different, and I'm not even sure what the option would be in macOS.

I don’t think NixOS (where service configuration would live) is system-agnostic. It relies heavily on systemd already.

Re: Will Nix Overtake Docker?

#103
post #50

Earlier quoted context omitted.

> There's a blog post that goes around from time to time about how a company have three risk tokens to allocate per project on non-boring technologies. https://mcfunley.com/choose-boring-technology

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.

Re: Will Nix Overtake Docker?

#104
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

Re: Will Nix Overtake Docker?

#105
post #97
post #4

I've set up my new M1 MacBook Pro using Nix and it's been going relatively well. Home Manager manages global tooling like Neovim, random CLI tools, and config files while I've set up `default.nix` files to use with `nix-shell` per-project. The set up of each project can be a little tedious as I still find the language confusing but once everything is set up the reliable re-creation is excellent. I love the feeling of…

I have a Makefile that I use when I need to spin up a new laptop [1]. For your description it sounds like it is functionally similar. What does nix bring that a Makefile like this one doesn’t? [1] https://github.com/jchilders/dotfiles/blob/main/Makefile

Drift. Nix (effectively) does not mutate in-place, it rebuilds and links. Delete a target from that Makefile and it doesn’t actually remove that thing. It’s the same problem Ansible etc. have. It’s not till actually fully reinstalling the OS that all the implicit dependencies reveal themselves. Sure one can write “clean” targets but the point of Nix is that such manual management is unneeded.

Re: Will Nix Overtake Docker?

#106
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.

That is extremely concerning, then, that it is so difficult to use after all that time.

I had hopes in the back of my head that "maybe it'll get better/more ergonomic in the next few years".

Re: Will Nix Overtake Docker?

#107
post #87

As far as I understand nix, the nix examples do not create a reproducible environment because it is not locking the versions down for each package, including nixpkgs. https://nix.dev/tutorials/towards-reproducibility-pinning-ni...

Ass that article says, it’s possible but awkward. It gets better with Flakes https://nixos.wiki/wiki/Flakes

Re: Will Nix Overtake Docker?

#108
Who cares? I've spent years ignoring mainstream, "senior", etc devs' opinions on both Nix and Haskell. "Nobody uses it," "it's too complicated," "bet on mainstream X," "it's too hard to learn."

Guess what? If has paid off in terms of personal efficiency - and I can make a good living doing it to boot with some effort.

If you want to aim for the mountaintop, don't let the weight of cynical complainers hold you back. Remember: It takes guts to be amazing.

Re: Will Nix Overtake Docker?

#109
post #43

Earlier quoted context omitted.

If there are too many packages to pin, then I assume there are too many package to audit changes in for each image build you do? If that is true, how do you have any confidence that the image is going to function correct?

I think we're talking about two different things. I'm thinking of pinning packages as say, my npm.lock specifies I will use version 2.2.19 of tailwind css. Or my Dockerfile has redis:6.2.6 as it's base image. Both of those are fully pinned, but nothing stops Tailwind or Redis from uploading new versions of the package and reusing the version number (I believe NPM actually disallows this, Docker hub does not). So my b…

You can reference docker images by their SHA digest which is immutable, e.g.:

    docker pull redis@sha256:619af14d3a95c30759a1978da1b2ce375504f1af70ff9eea2a8e35febc45d747

Re: Will Nix Overtake Docker?

#110

Earlier quoted context omitted.

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

That is extremely concerning, then, that it is so difficult to use after all that time. I had hopes in the back of my head that "maybe it'll get better/more ergonomic in the next few years".

Is it? Or is it just a tool that requires a different mindset so those coming to it from another regular distro? If the latter, then I’m not sure it’s something they will see as a problem but more its very ethos.
Post reply on HN