One thing people forget is containers don’t necessarily not to be created with Docker. Lately I’ve been creating containers using NixOS and couldn’t be more happy with the ability to have everything in the container configured by a configuration.nix file. https://nixos.org/nixos/manual/#ch-containers The idea of a Docker Ubuntu, Arch, Alpine, etc base image is kind of silly when you think about it. The idea that we h…
How is a configuration.nix any different than a Dockerfile?
Another advantage is a unified development environment as I can run the server in the container or directly on host machine in an isolated nix-shell.
Yet another advantage, is unlike the layer of a docker container, isolated dependencies are isolated and linked so packages link together based on a hash-address/path of a dependency in the nix store so there is no need to worry about order of steps but rather what depends on what making the cache misses in a nix-store vs a docker layer more efficient. For example if the first step in a Dockerfile needs to be changed all proceeding steps need to be rebuilt where as if a dependency in a nix file say paython-2 to python-3, every package that depends on python just get re-linked and only those packages need to be updated and you already have python-3 used in a nix-shell or in another container odds are it's already cached and ready to go!