jenkinsci / jenkinsci/docker-workflow-plugin
[JENKINS-45888] Image.inside and Agent should use --init with 'docker run'
- Dominant language
- Java
- Stars
- 527
- Forks
- 422
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
When Image.Inside() or an "agent { docker ... }" is used to docker run ... cat a docker container, it should always use the --init flag.
```
--init Run an init inside the container that forwards signals and reaps processes
```
This creates a PID 1 --init process that is sometimes needed to properly shutdown a container with multiple processes inside it.
A lot of build containers can start up a bunch of processes that may not be properly reaped or may not properly receive TERM and QUIT signals when trying to shutdown a container.
This should fix problems like JENKINS-37769 and JENKINS-32859
---
Originally reported by
docwhat, imported from: Image.inside and Agent should use --init with 'docker run'
Raw content of original issue
When Image.Inside() or an "agent { docker ... }" is used to docker run ... cat a docker container, it should always use the --init flag.
--init Run an init inside the container that forwards signals and reaps processesThis creates a PID 1 --init process that is sometimes needed to properly shutdown a container with multiple processes inside it.
A lot of build containers can start up a bunch of processes that may not be properly reaped or may not properly receive TERM and QUIT signals when trying to shutdown a container.
This should fix problems like
JENKINS-37769and JENKINS-32859
Contributor guide
Assessment
This issue has not been assessed yet.