Hacker News new | ask | show | jobs
by microtonal 2546 days ago
You can easily build Docker images using Nix. Benefits: (1) reproducability, if you pin to a certain nixpkgs, you always get the same set of packages; (2) layers don't have to be full filesystem diffs; (3) the image only contains the computed closure. E.g. I produce Docker images an NLP program with Nix. The image only contains: glibc, tensorflow, my program, word embeddings, the model. No other system files or dependencies. Since the image build expression uses Nix expressions, I can also directly use the same models on my Linux workstation, Linux servers, macOS, etc. without Docker.

This is a good starting point:

https://grahamc.com/blog/nix-and-layered-docker-images