Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45888

Image.inside and Agent should use --init with 'docker run'

      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

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

          Jesse Glick added a comment -

          What is this flag? Not present in Docker 1.12.6 AFAICT.

          Jesse Glick added a comment - What is this flag? Not present in Docker 1.12.6 AFAICT.

          It runs a built-into-docker init process as PID 1.

          The documentation from ‘docker run --help‘ is above.

          I'm not sure when it added. Probably around when things got renumbered.

          https://stackoverflow.com/questions/43122080/how-to-use-init-parameter-in-docker-run

          Christian Höltje added a comment - It runs a built-into-docker init process as PID 1. The documentation from ‘docker run --help‘ is above. I'm not sure when it added. Probably around when things got renumbered. https://stackoverflow.com/questions/43122080/how-to-use-init-parameter-in-docker-run

          The --init flag was added in the Docker 1.13.0 release

          benjamin dewan added a comment - The --init flag was added in the Docker 1.13.0 release

            Unassigned Unassigned
            docwhat Christian Höltje
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: