From 15a64e2ab020633208a37177c7c5e7402300db03 Mon Sep 17 00:00:00 2001 From: Mathias Westerdahl Date: Fri, 12 Jan 2018 14:11:01 +0100 Subject: [PATCH] PID1 fix for orphaned wine processes (wineserver et al.) (#57) --- server/docker-base/Dockerfile | 6 ++++-- server/docker/Dockerfile | 11 +++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/server/docker-base/Dockerfile b/server/docker-base/Dockerfile index e7c4affe..d86ee792 100644 --- a/server/docker-base/Dockerfile +++ b/server/docker-base/Dockerfile @@ -1,5 +1,7 @@ -FROM ubuntu:16.04 - +# To solve the PID1 zombie process issue +# http://phusion.github.io/baseimage-docker/ +# It derives from ubuntu:16.04 +FROM phusion/baseimage:0.9.22 # Base stuff RUN \ diff --git a/server/docker/Dockerfile b/server/docker/Dockerfile index 8484fcff..7edbbf10 100644 --- a/server/docker/Dockerfile +++ b/server/docker/Dockerfile @@ -3,7 +3,14 @@ FROM extender-base ADD extender-0.1.0.jar app.jar RUN chown extender: app.jar -USER extender +# Create a daemon script for the extender (Execute the internal command as the extender user) +RUN mkdir -p /etc/service/extender && \ + echo "#!/bin/sh" > /etc/service/extender/run && \ + echo "exec /sbin/setuser extender java -Xmx500m -jar /app.jar" >> /etc/service/extender/run && \ + chmod +x /etc/service/extender/run && \ + chown extender: /etc/service/extender/run + +# Needs to run as root +CMD ["/sbin/my_init"] -ENTRYPOINT ["java","-Xmx500m","-jar","/app.jar"] EXPOSE 9000