3 ms·
One of the main reasons I use Docker is being able to run the exact same Dockerfiles locally and in prod, with virtualisation taken care of automatically on e.g
by simongray 4y ago
One of the main reasons I use Docker is being able to run the exact same Dockerfiles locally and in prod, with virtualisation taken care of automatically on e.g. Mac.
Is Nix a viable alternative to that?
- ParetoOptimal 4y ago> Is Nix a viable alternative to that? Yes, it even provides stronger reproducibility guarantees that what you build locally and what's on prod are exactly the same. You can also build a docker container from the Nix expression, see: https://nix.dev/tutorials/building-and-running-docker-images https://nix.dev/tutorials/building-and-running-docker-images If you are interested, I recommend then also checking out https://zero-to-nix.com/ https://zero-to-nix.com/
- bsnnkv 4y agoAgain, just my experiences as a long-time DevOps person- you can build Dockerfiles on two different machines and get two entirely different results (ie. success vs failure), and especially on macOS, Docker performance is quite poor, even moreso when mounting directories from the host. Nix on the other hand will produce the same result every time wherever I run it. This alone for me is enough reason to prefer it over Docker the majority of the time.