I have a Nix package I'd like to bundle up into a docker container.
Specifically, I want to use Nix as a more expressive alternative to a Dockerfile
to have faster (non-linear) image builds.
I've found documentation on dockerTools.buildImage
but I'd like to have a minimal working example, and I'd also like to know what ends up being in the docker container.
The following example packages (using
contents =
) thepkgs.nginx
nixpkgs package into a docker container:You can then run it with
The contents of the container are pretty minimal, a single Docker layer:
Only htop and its dependencies (glibc, ncurses), 26 MB on my case.