From 31d6d84433e13390b770e7ff6c430f1652ce90bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sat, 20 Mar 2021 12:21:20 +0100 Subject: [PATCH] Use tini as PID 1 inside the container tini [1] is a minimalistic PID 1 process. It correctly handles the special jobs which PID 1 (or a reaper process in general) needs to take care of in addition to correctly processing the relevant signals. Fixes #68. [1]: https://github.com/krallin/tini --- Dockerfile | 1 + entrypoint.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 02d1301..8dc6571 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,7 @@ RUN apt-get update \ openssl \ ca-certificates \ ssl-cert \ + tini \ && rm -rf /var/lib/apt/lists/* # Install and configure prosody diff --git a/entrypoint.sh b/entrypoint.sh index 63ae7c6..8be3dd0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,7 +10,7 @@ if [[ "$(stat -c %u /var/run/prosody/)" != "$data_dir_owner" ]]; then fi if [[ "$1" != "prosody" ]]; then - exec prosodyctl "$@" + exec tini -- prosodyctl "$@" exit 0; fi @@ -18,4 +18,4 @@ if [[ "$LOCAL" && "$PASSWORD" && "$DOMAIN" ]]; then prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD" fi -exec runuser -u prosody -- "$@" +exec tini -- runuser -u prosody -- "$@"