Live data from Hacker News

Will Nix Overtake Docker?

blog.replit.com

151–160 of 259 posts

Re: Will Nix Overtake Docker?

#151
Nix will not overtake Docker because 1. The overlap is not that big 2. Nix has usability issues

That being said Nix even with its usability issues works better for reproducible development environments than anything else (including Docker) ATM. Therefore in my view either Nix or something very similar will be the solution for this and replace Docker (some people run builds using Docker containers) for this use case.

Re: Will Nix Overtake Docker?

#152

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.)

on docker for linux you get different hosts for the containers. you'll still need to BYO way to assign them names -- I personally use direnv for this

I think this doesn't work as well on docker desktop for mac

Re: Will Nix Overtake Docker?

#153
post #132

For containers? No way, Dockerfiles are much simpler than nix configuration. For workstations? ostree is the future, not nix, IMO. Check out Silverblue. Flatpak takes care of the desktop aspect. NixOS is an interesting attempt at solving the reproducibility problem, but it hasn't been adopted because it's just a stepping stone towards a better solution. It has far too many quirks to hit mainstream, it's too complex,…

>Dockerfiles are much simpler than nix configuration

I highly doubt this, Dockerfiles are simpler for a hello world microservice, but they get worse and unmaintainable when you add them lots of them with docker-compose.

>ostree is the future, not nix >flatpak takes care of the desktop aspect

I really hate the approach this approach, it just moves the state from the root system to the user. The root directory is immutable, but you move the whole responsability to Flatpak, which is not even comparable to nix. Meanwhile, in case of Nix, the whole system is reproducible and settings are more and less immutable.

>it's too complex

My whole nix config (with specific configs for vscode, neovim, chromium, wireguard, rust, python, nodejs, c++, go) is less than 600 lines of code, and it's readable. Also I configure most of my open source projects via nix as well as it's pretty easy to share the environment with the other developers. Nix works everywhere, on every linux distro, macOS and even Windows via cygwin or wsl.

>under documented

That's a really good point, nix maintainers didn't care much about documentation, but usability. But it looks like that's changing, they moved docs to mdbook and a team is working specifically on improving the docs

Re: Will Nix Overtake Docker?

#154
post #126

I don't like nix[1], but I sure hope it will overtake docker. Any theoretical foundation is better than no foundation. [1] https://lobste.rs/s/sizjqf/migrating_from_docker_podman#c_op...

It kinda sounds like your main gripe with Nix is that it's a source-based package manager with transparent binary caching rather than a binary package manager.

I think that's a mistake, but it's true that Nixpkgs suffers in some places from missing or overlapping abstractions.

Re: Will Nix Overtake Docker?

#155
I have some experience using docker/docker-compose, like world+dog. Mostly it's good. Docker is simple, or it can be if you don't over engineer things. Simple is why docker got popular. The other reason it is popular is because it decouples to process of provisioning software from deployment and infrastructure provisioning which these days are separate activities typically done by different people/teams/organizations. Splitting responsibilities for this is a big win. If you self host all of that might be internal to your org but it still allows you to split the responsibility across teams.

I have no experience with Nix. But a couple of red flags jump out of this thread for me are that "it's complicated", Haskell is somehow involved, and it is vaguely suggested that this is somehow similar to Docker. Which is clearly not the case.

When it comes to putting stuff in a docker container, I guess you could use Nix. But why would you? It makes about as much sense as using Ansible or Puppet for that.

Nothing against Haskell, but it evokes an image that might be a bit harsh to some but probably rings true to many: the wrong people getting excited for the wrong kind of reasons. I'm talking over-engineering here. People getting overly excited and creating a mess of hard to understand code that becomes a burden for whomever has to train up to maintain that code. People wielding hammers looking for ever more nails to wack.

I've unceremoniously ditched multiple configuration languages over the years. Usually it feels good getting rid of all the over engineered crap when you realize you don't need most of it anymore. Of course the flip side is that what you replace it with might end up being similar. Been there and done that.

However, I seem to only need a few lines of Dockerfile to replace what used to be a convoluted mess of puppet or ansible scripts to provision a thing that runs our thing. No longer needed. No more obsessing on how to, for example, get NTP tell the time to a server and why that somehow requires wrapping your head around a 600 line puppet module that does god knows what. Not a thing anymore.

Nix sounds more like that than like Docker. I used to know people that actually used puppet to setup their laptop. Nix might be a better product for that. But I'm looking to minimize the need for that entirely. Dockerized development environments are great for that. A laptop with a browser running vs code is all you need these days. People are using freaking ipads to do development even.

Re: Will Nix Overtake Docker?

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

Your Makefile is not a reproducible build. You would need to pin all the versions of the tools being used. Also as others have mentioned, Nix ensures that you do not rely on unspecified dependencies.

Re: Will Nix Overtake Docker?

#157

I think people are missing the forest for the trees with this. In my view, the reason Docker has all the hype is because I can look at a Dockerfile, and know what's up. In seconds. Sometimes in milliseconds. It's a user experience thing. Yes, Nix is better for 'technical people that spent the time learning the tool', but Dockerfiles rely almost entirely on existing System knowledge. Yes, Nix is 'better', but the fact…

> In my view, the reason Docker has all the hype is because I can look at a Dockerfile, and know what's up. In seconds. Sometimes in milliseconds.

Most of the times this just gives me more questions than answers, like: what does the entrypoint.sh file in this repo do? Only to discover a plethora of shell script for setting up the runtime environment based on different environment variables. Most of the time not aligned with any common standard or with how you generally would setup the application itself.

Re: Will Nix Overtake Docker?

#158
I like the idea, but it's implemented badly. Docs are not clear and syntax is just complex and odd. Nor do i know which packages i can install, i tried to click the "packages" link on their website, but those packages seem to be for something called "nixos" which is probably something different than just "nix". anyway. it's just confusing for no reason. That being said, the concept is alot better than docker. Docker is somewhat the worst idea ever and i find the people using it always have no understanding on how software works or computers in general. As for the article, as long as nix doesnt fixes their weirdness, docker will still be used. also docker is cross platform.

Re: Will Nix Overtake Docker?

#159
post #150

Along my life, i have worked with a lot of build systems, but I find Nix syntax and commands to be completely awful! I see that it could be useful, but it completely turns me down immediately.

I don't get all the hate for the Nix language. It seems really simple and flexible to me. What do you dislike about the language?

I can't really say, but when I see it, I have the feeling that it is made of the worst parts of perl, bash, javascript, ... all combined together.

Re: Will Nix Overtake Docker?

#160

Earlier quoted context omitted.

I feel similarly with Docker. But it's easier to explain to newer folks because it's only a single layer of abstraction above shell commands.

I really wish something like singularity containers had taken over -- that was literally just shell commands.

Possibly https://buildah.io/ would be of interest.
Post reply on HN