This question is only half related to Dagger. Most of it is probably related to Buildkit / Docker more. I wasn't sure how to formulate this better. Here the case...
I've written a pipeline in Dagger, and everything is working as expected. One of the steps in my pipeline is using with_exec to run a test suite. The test suite I'm running reports a handful of failures. I need to investigate what is it exactly that causes the failures.
Ideally, in order to reduce the feedback loop I want to enter a container at the failing step of the pipeline: look around the file system, try running the test manually, update the test code with printf statements, etc.. Something in the surrounding container environment makes the test fail, and I just need to understand what it is.
Once I know why the tests are failing, I would go back and update the pipeline (set ENV, add missing permissions, files, etc.) based on the findings.
Because Dagger is using buildkit, all pipeline "steps" are cached, e.g. buildkit stores the cache somewhere on the disk. So, I assume, there must be a way to "manually" restore the cache, making (?) an image out of it. That image then could be entered by docker run -it image-restored-from-cache bash to do manual forensics.
P.S. I initially thought that cache is some analogy of "intermediate" layers of Docker. However, merely running docker images -a does not reveal the cache I am looking for - because, I assume, buildkit cache and intermediate docker images - are two completely different things.
Any ideas, how do I make an image out of failing Dagger step? π€