From 64c0c7a8eebb82e373c03f6ecc7668e17b9ff00a Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Sun, 16 Nov 2025 17:21:59 -0600 Subject: [PATCH] fix(docker): avoid delayed termination due to signal handling This commit introduces `tini` (https://github.com/krallin/tini, as seen in Docker >= 1.13) as an init process for the container. This should fix several issues that arise from the current Docker setup. Currently, the container runs `sym_service` via a shell command (`sh -c "/opt/symmetric-ds/bin/sym_service start && tail -F ..."`). This setup causes the shell to become PID 1, and signals such as `SIGTERM` or `SIGINT` sent to the container do not reliably reach `sym_service`. In practice, this leads to: - Ctrl+C in local testing often times out because the service never receives the termination signal. - `docker stop` commands take longer than necessary, as the service cannot shut down gracefully. - Kubernetes deployments experience delayed pod termination. --- symmetric-assemble/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/symmetric-assemble/Dockerfile b/symmetric-assemble/Dockerfile index 8deee49f8e..d756a184cd 100644 --- a/symmetric-assemble/Dockerfile +++ b/symmetric-assemble/Dockerfile @@ -15,6 +15,9 @@ RUN mkdir -p /opt/ RUN mv symmetric-server* /opt/symmetric-ds RUN chmod -R u=rwX,g=,o= /opt/symmetric-ds/security +# Install tini +RUN apk add --no-cache tini + ENV SYM_HOME /opt/symmetric-ds # Create a volume containing the engines, tmp, conf, and security directories @@ -26,4 +29,5 @@ VOLUME /opt/symmetric-ds/security EXPOSE 31415 EXPOSE 31417 -CMD /opt/symmetric-ds/bin/sym_service start && tail -F /opt/symmetric-ds/logs/symmetric.log \ No newline at end of file +ENTRYPOINT ["/sbin/tini", "--"] +CMD ["/bin/sh", "-c", "/opt/symmetric-ds/bin/sym_service start & tail -F /opt/symmetric-ds/logs/symmetric.log"]