It’s common to have a sequence like
run some docker thing,
stop docker. You can’t cache each task, but you can (or at least should be able to) cache the full group of them.
I put together a prototype for this functionality called cache-horizon. I’m stuck, if you’re interested I could use your help.