jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-45888] Image.inside and Agent should use --init with 'docker run'

Open
#509 5 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:minor resolution:unresolved
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'


  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • label(s): docker
  • resolution: Unresolved
  • votes: 2
  • watchers: 5
  • imported: 2025-12-07

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 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.