3 ms·
> Does it make sense to use nix during the image build process to precisely define dependencies I want to have in the resulting container? Using a dockerfile w
by rgoulter 3y ago
> Does it make sense to use nix during the image build process to precisely define dependencies I want to have in the resulting container?
Using a dockerfile with a step like "RUN nix ..."? You can, but it strikes me as a cumbersome way of doing things. Mitchell H describes this way of doing things here: https://mitchellh.com/writing/nix-with-dockerfiles https://mitchellh.com/writing/nix-with-dockerfiles
Whereas, I'd reckon the more idiomatic thing to do is to build the Docker image with Nix code. -- You're going to get a precisely defined environment to share across workstation/CI/etc. Some example Nix code for building Docker images is here https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/docker/examples.nix https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-supp...
- dusanh 3y agoThanks for the links, that is very useful! It seems like I was thinking about this process the other way around.