4 ms·
Containers are great, but everything else that Docker does is very meh. Slow, inconvenient, hard to work with. What I'd really want is a system that takes nix
by dpc_pw 7y ago
Containers are great, but everything else that Docker does is very meh. Slow, inconvenient, hard to work with.
What I'd really want is a system that takes nix files (see Nix & NixOS), and gets that running as a container. Or something like that: Guix or whatever else. Free package-level caching and deduplication, and so on.
- Kaze404 7y agoDoesn't the NixOS CLI do exactly that with virtual machines?
- servilio 7y agoYes, the nixos-container command. That's the imperative approach, you can also do it declaratively. https://nixos.org/nixos/manual/index.html#ch-containers https://nixos.org/nixos/manual/index.html#ch-containers
- zimbatm 7y agohttps://nixery.dev/ https://nixery.dev/ does some of this. `docker pull nixery.dev/shell/git/htop` and you get an image built on the fly with bash, git and htop in it. Each loaded in their individual layers. For a push approach, I am maintaining this project: https://github.com/nix-community/docker-nixpkgs https://github.com/nix-community/docker-nixpkgs Both work well for CLI-like applications. What is missing is to get something similar for services where there is a mix of configuration coming from environment variables and files.
- dpc_pw 7y agoThanks. I will look at this and other comments, but I don't want stuff that involves docker in any way. Only NixOs + containers.
- mikepurvis 7y agoI asked about this a few months ago on here and was pointed to this: https://grahamc.com/blog/nix-and-layered-docker-images https://grahamc.com/blog/nix-and-layered-docker-images It's far from a native solution, and is a bit hacky due to the 256 layer limitation in docker, but it's most of the way to what you want, I think.
- ryukafalz 7y agoGuix has that built in, effectively - you can build a Guix operating-system as a container to run on the same system (this shares the host machine's store for deduplication), or a Docker image if you want to ship it to a machine that's not running Guix. See docker-image and container here: https://guix.gnu.org/manual/en/html_node/Invoking-guix-system.html https://guix.gnu.org/manual/en/html_node/Invoking-guix-syste...
- servilio 7y agoHave you taken a look at NixOps[1] and Disnix[2]? They extend the concepts of Nix and NixOS into networks of machines and distributed services (TL;DR version). If you are using only one system, the NixOS containers support might be enough, though. [1] https://nixos.org/nixops/ https://nixos.org/nixops/ [2] https://nixos.org/disnix/ https://nixos.org/disnix/
- dpc_pw 7y agoI did used nixops. I quite enjoyed it, though the local state database was annoying. I wish it was more like k8s, keeping its state internally in a distributed db. I'll look into disnix. Thanks!
- servilio 7y agoTrue, are you aware of the following Github issue related to this? https://github.com/NixOS/nixops/issues/565 https://github.com/NixOS/nixops/issues/565 It has links to solutions people are using, and other related issues.