Prevent jenkins to leak zombie processes
fix issue #54
diff --git a/Dockerfile b/Dockerfile
index 4a24d0e..f8a55a7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,6 +18,8 @@
# 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 @@
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