Show HN: Building better base images
38 akrylov 15 4/11/2025, 12:56:02 PM github.com ↗
This project addresses the inefficiencies of traditional Dockerfile-based container builds where each customization layer creates storage bloat through duplicate dependencies from repeated apt-get install commands, network inefficiency from redundant package downloads across different images, and slow iteration cycles requiring full rebuilds of all previous steps. Our solution enables building minimal base images from scratch using debootstrap that precisely include only required components in the initial build, while allowing creation of specialized variants (Java, Kafka, etc.) from these common foundations - resulting in significantly leaner images, faster builds, and more efficient resource utilization compared to standard Docker layer stacking approaches.
Is there an advantage to that over combining layers and using cache mounts to avoid those redundant downloads?
A side-by-side comparison of dive's output would be helpful (https://github.com/wagoodman/dive).
Also can you clarify what you mean by "requiring full rebuilds of all previous steps"?
Imagine you work at a large org and you want to control all images used for CI/CD workers. Instead of scattering it across different Dockerfiles and scripts (Java, NodeJS, python, etc) you can just use a single tool. At least it was why I built it in the first place.
FROM your_image as initial
FROM scratch
COPY --from=initial / /
Personally I've soured on the Dockerfile approach as it feels like we're just shuffling bytes around rather than composing something.
https://nix.dev/tutorials/nixos/building-and-running-docker-...
The supposed "caching" of layers really doesn't work in practice unless you add a bunch of other infrastructure and third-party tooling to your build process. Getting truly incremental and reproducible layers into your build process is non-trivial, and the Dockerfile approach fails to take advantage of that work once you've done it.
[0] https://stagex.tools/
nix build github:NixOS/nixpkgs#pkgsStatic.git
return the pacakge as:
ls -lah git
-r-xr-xr-x 1 rucadi rucadi 5.1M Jan 1 1970 git
ldd git
$ not a dynamic executable
So you don't really need to really grow the container