I'd like to recycle and update my VMs that I use for my self-hosted Bitbucket runners on a regular basis. There's no time of day where I can be certain that the runners aren't doing some work on behalf of pipelines in Bitbucket.
That means I can't just blindly shut things down. I need to drain and restart them in a less interruptive way.
Is there a way to tell a docker-based runner to shut itself down after it finishes with whatever current task it happens to be processing?