From 43a7c706038f1ada33c089408834ec0c740485b6 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Sun, 19 Apr 2020 11:03:30 +0200 Subject: [PATCH] Add tini to Dockerfile and use it as entrypoint This change adds [tini](https://github.com/krallin/tini) as the init process for the Teslamate Docker container. The reason for this is that currently the container runs with zombie processes. This means the current process with PID=1 in the container doesn't reap children properly and given the output I get while fixing this, child processes are dying accidentally. There's also an option to work around this with docker-compose since compose file version 3.7, which allows passing `--init` for the docker container. I'm currently using that to work around the zombie processes, but adding tini fixes this independent of how people run this container. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 655de0b96d..77de9aafeb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ ENV LANG=C.UTF-8 \ SRTM_CACHE=/opt/app/.srtm_cache \ HOME=/opt/app -RUN apk add --update --no-cache bash openssl tzdata +RUN apk add --update --no-cache bash tini openssl tzdata WORKDIR $HOME RUN chown -R nobody: . @@ -44,5 +44,5 @@ RUN mkdir .srtm_cache EXPOSE 4000 -ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] +ENTRYPOINT ["/sbin/tini", "--", "/bin/sh", "/entrypoint.sh"] CMD ["bin/teslamate", "start"]