3 ms·
If you use Nix that's pretty much how the container will be build. You specify that your app should be there and Nix, being aware of all dependencies will place
by takeda 3y ago
If you use Nix that's pretty much how the container will be build. You specify that your app should be there and Nix, being aware of all dependencies will place inside everything needed.
- iopq 3y agoCame to say this, in the case of sane things* Nix works perfectly * pip is not guaranteed to get you to a working state even if you run the same commands, so don't even think about it
- aliasxneo 3y ago> will place inside everything needed And more. In my experience, depending on the quality of the packages you happen to be consuming, you may end up with a container twice as large as a comparable (say, Alpine) container. For example, I once tried to bring git into my Nix container and was surprised to see over 300MB in increased size. After having built Nix containers exclusively for a year now, I wouldn't really recommend it to others unless you're willing to invest a lot of additional time cleaning up community packages.
- takeda 3y agoThat's because by default Nix uses glibc (which is huge), while Alpine uses musl. You can create musl binaries, but you need to know Nix a little more and know how to cross compile. Another great thing is that you can can easily modify existing package to remove some of their dependencies that you don't use. This is shown here with packaging redis into a container here and making it 3x smaller than the alpine version: https://nixos.org/#asciinema-demo-cover https://nixos.org/#asciinema-demo-cover There's of course possibility that someone specified build dependency as a runtime dependency, but if that was done that's a bug.