title: How can I delete partially built docker images?
body: <p>I have three parallel jenkins builds. If one of the builds (the Linux build) fails, all the rest builds (two Windows builds that take much longer time and run on one Windows jenkins node) are interrupted.</p>
  <p>If they are interrupted <strong>after</strong> their <code>docker build -t mytag:myname ...</code> is finished to execute,  everything is alright and they are deleted in jenkins' <code>post always</code> section by <code>docker rmi mytag:myname</code>.</p>
  <p>However, if the Windows builds are <strong>not</strong> finished, their images are left unnamed/untagged and I end up with them left undeleted after the failed jenkins job. And I am afraid of eating up all the storage on the Windows jenkins node.</p>
  <p>I also must mention that I cannot run parallel docker <code>prune</code> commands in jenkins on the Windows node, because I get error: <code>Error response from daemon: a prune operation is already running</code>, as these commands end up being executed at once on the one Windows jenkins node.</p>
  <p>The only idea I have: to have weekly cron on Linux/Windows jenkins nodes doing <code>docker system prune -a</code> every Sunday.</p>
  <p>I would really appreciate any ideas on how these partially built images could be eliminated on the Windows node.</p>