How to connect to broken build

I have a build failing on gitlab.com. It works fine on my localhost.
On my localhost, I can connect to a previous intermediate image and diagnose
problems with a command like this docker run --rm -it 3f52d8a8eeb6
How can I do something similar with gitlab/kubernetes?

Also, possibly unrelated but my project is refusing to use the cache. I turned off public runners and created a private runner and it still won’t utilize the cache.