Show HN: Building better base images
github.com
github.com
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-...
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
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.