Docker containers are left running when Jenkins jobs are killed/aborted
This has been going forever, and I tried to use a dedicated job to clean up orphan containers with not much success.
Recently we started to have a higher rate of automatic restarts, which leave the system in a mess.
A better solution than the clean up job is to kill the owned container when the job is aborted and according to https://stackoverflow.com/a/20349667 we could use a signal handler in the script that is executed.