From 3ae497e2eb5ac0360b4f90917d2fb92d027c0527 Mon Sep 17 00:00:00 2001 From: Darksider3 Date: Thu, 17 Oct 2019 13:34:43 +0200 Subject: [PATCH] Let the container stop gracefully with exec! Right now the container can't stop gracefully because the sshd-server runs on the server as PID 0. This results in the docker daemon not killing it but waiting for it to die, which never happens, and results in the default timeout-wait before it KILLS the process. With exec, the sshd becomes PID 1 and can receive and process signals(probably SIGTERM here) and handles them as well. The container stops now nearly instantly.. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 168d461..0e3e6ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,4 +42,4 @@ RUN touch /app/data/applications.log #RUN setfacl -R -m u:tilde:rwx /app/data/ RUN chown -R tilde /app/data RUN mkdir /app/user/.ssh -CMD ["sh", "-c", " echo TILDE_CONF=$TILDE_CONF > /app/user/.ssh/environment && /usr/sbin/sshd -D"] +CMD ["sh", "-c", " echo TILDE_CONF=$TILDE_CONF > /app/user/.ssh/environment && exec /usr/sbin/sshd -D"]