Re:The Magic Nix Cache, a GitHub Action for speeding up your...
by dusanh on Tuesday June 27, 2023 @01:39AM
(#36489275)
Does it make sense to use nix during the image build process to precisely define dependencies I want to have in the resulting container? Or perhaps in other words, can I use nix and docker together, to have a precisely defined environment I can share with others devs as a result?
[ Parent
| on HN ]
Re:The Magic Nix Cache, a GitHub Action for speeding up your...
by dlahoda on Tuesday June 27, 2023 @03:40AM
(#36489995)
yes. nix builds linux filesystem with all dependencies and puts it into oci image.
so locally i use process-compose to avoiding waiting docker builds.
Re:The Magic Nix Cache, a GitHub Action for speeding up your...
by dusanh on Tuesday June 27, 2023 @02:11PM
(#36496587)
Hm, I skimmed the github page for process-compose and I don't understand how it is different from building the container image directly with nix.
Re:The Magic Nix Cache, a GitHub Action for speeding up your...
by rgoulter on Tuesday June 27, 2023 @04:25AM
(#36490310)
> 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
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-supp...