Initially described in T176623#3635213 and T176623#3635269
If jenkins kills the job, for example in https://integration.wikimedia.org/ci/job/lintr-docker/26/console, the container will actually continue running until the command has finished which leads to problems.
- Slaves can become saturated as the next job may immediately start running
- Jobs will be running in the same workspace
Perhaps the docker plugin handles this nicely?
See also https://issues.jenkins-ci.org/browse/JENKINS-17116
We used docker run --tty but --tty always disable signal proxying and thus Jenkins SIGTERM is not relayed to the container. Mentioned to upstream as https://github.com/moby/moby/issues/9098#issuecomment-347536699
We want to catch Jenkins SIGTERM and docker stop.