-
If you're using Go, I recommend https://github.com/google/ko (shameless plug), or for Java, use Jib.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
There's also (another shameless plug) crane append which simply adds the contents of a tar to an existing base image directly in the registry: https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane_append.md
-
Moby
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
COPY --exclude. https://github.com/moby/moby/issues/15771
-
With Nix you have to look up obscure sites like this and look for specific hashes and pray that the version you need exists (or package it and distribute it yourself). Approaches like this are not that inviting.
-
Lean and Mean Docker containers
Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Or you can save your time micromanaging your Dockerfile and just use docker-slim.
-
Similarly, Dockerfile with buildkit support a 'COPY --chmod' directive now. https://github.com/moby/buildkit/pull/1492. Again not quite everything you're looking for, but addresses the OP's issue.