3 ms·
> Is this obvious, simple, and default behaviour? In the documentation[0] they're right next to each other, and `buildImage`[1] (builds a single layer) specifi
by Nullabillity 1y ago
> Is this obvious, simple, and default behaviour?
In the documentation[0] they're right next to each other, and `buildImage`[1] (builds a single layer) specifically calls out that you probably want to use `buildLayeredImage` or `streamLayeredImage`[2] (both produce a separate layer per dependency) instead.
Neither should cause the final image to include build dependencies, that sounds like they were doing something silly like running `nix-build` from inside a Dockerfile and just taking that as their final image. Which.. yes, would include build cruft. Oh,[3] I guess that was exactly what they were doing after all. And mixing in Debian packages... for reasons, I guess.
[0]: https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTools https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTool...
[1]: https://nixos.org/manual/nixpkgs/stable/#ssec-pkgs-dockerTools-buildImage https://nixos.org/manual/nixpkgs/stable/#ssec-pkgs-dockerToo...
[2]: https://nixos.org/manual/nixpkgs/stable/#ssec-pkgs-dockerTools-streamLayeredImage https://nixos.org/manual/nixpkgs/stable/#ssec-pkgs-dockerToo...
[3]: https://github.com/railwayapp/nixpacks/blob/205b33b515282cdf56cb4848f01274bd858f850e/src/nixpacks/builder/docker/dockerfile_generation.rs#L126-L128 https://github.com/railwayapp/nixpacks/blob/205b33b515282cdf...