How do I clear the permanent docker agent cache after tpJobRun in Jenkins?

I need to use the tpJobRun method in Jenkins, so I am forced to use permanent docker agents instead of ephemeral agents. However I noticed that permanent docker agents have a greater chance of getting stuck/not working/etc. than ephemeral agents, probably because of the cache from previous test runs. How can I clear the cache after running a test job, so it wouldn’t affect the next run?

Thanks in advance.

Hi @mw3deJTZM4Acmk,
You can try use the docker builder prune -a command to delete unused cache.
Let me know if it solves your issue.