Re:Spectrum OS: a declarative, reproducible, compartmentaliz...
by lom on Wednesday September 15, 2021 @12:10AM
(#28535185)
I was building a docker image today with nix, but to my demise it ended up being over 90mb (loaded into the docker daemon). How can I make a docker image smaller?
[ Parent
| on HN ]
Re:Spectrum OS: a declarative, reproducible, compartmentaliz...
by sterlind on Wednesday September 15, 2021 @12:31AM
(#28535288)
Make sure you're not bringing in superfluous dependencies. Use nativeBuildInputs (like devDependencies) when appropriate rather than buildInputs (like dependencies).
Re:Spectrum OS: a declarative, reproducible, compartmentaliz...
by lom on Wednesday September 15, 2021 @03:24PM
(#28543235)
Can I override stdenv to not pull in GNU stuff, but instead busybox. Or none at all? Stuff like that makes the image really small…
Re:Spectrum OS: a declarative, reproducible, compartmentaliz...
by sterlind on Thursday September 16, 2021 @12:40AM
(#28548097)
stdenv shouldn't end up in the container at all. the container should literally just contain your derivation and its transitive dependencies. your app, its actual dependencies, and nothing else. it won't even contain bash unless you or something you reference adds it. stdenv stuff is just used to build, it doesn't end up in there. maybe use one of the nix tools to show the actual dependencies you're bringing in and cut the fat.