I had an itch that I had to scratch so wrote a small tool. A few souls out there might find this useful. It’s git-bisect but through layers of a docker image rather than time.
You’ve broken your dockerfile somewhere and now your command doesn’t do what it should do. For example accidentally setting the env var for loading dynamic libraries so now when you run cargo in docker it doesn’t work.
cargo install docker-bisect
docker-bisect myimage:latest cargo
It will run the command (in this case ‘cargo’) on each layer of the image (as a separate container) and will report back which dockerfile lines caused the command output to change.
The repo is here:
PRs / suggestions / issues / feedback welcome! - If someone has done this before I’d also like to know as I couldn’t find any prior art.
I want to say what a pleasure it was to use the crates: clap, indicatif and especially dockworker.