From d5aea67dcae9d62fe4ca6ad961ffe66f65d9a591 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 15 Jul 2015 21:53:48 +0200 Subject: [PATCH] Prevent jenkins to leak zombie processes fix issue #54 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4a24d0e454..f8a55a70e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,8 @@ VOLUME /var/jenkins_home # or config file with your custom jenkins Docker image. RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d +# Use tini as subreaper in Docker container to adopt zombie processes +RUN curl -fL https://github.com/krallin/tini/releases/download/v0.5.0/tini-static -o /bin/tini && chmod +x /bin/tini COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy @@ -43,7 +45,7 @@ ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log USER jenkins COPY jenkins.sh /usr/local/bin/jenkins.sh -ENTRYPOINT ["/usr/local/bin/jenkins.sh"] +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"] # from a derived Dockerfile, can use `RUN plugin.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle COPY plugins.sh /usr/local/bin/plugins.sh