Docker Community Forums

Share and learn in the Docker community.

Using tini in Docker

I configured my Docker File like this:
NV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", “–”]
:
CMD ["/home/oracle/scripts/db_try.sh"]

The process list looks like this:
[oracle@devXE /]$ ps -ef
UID PID PPID C STIME TTY TIME CMD
oracle 1 0 0 19:40 pts/0 00:00:00 /tini – /home/oracle/scripts/db_try.sh
oracle 6 1 0 19:40 pts/0 00:00:00 /bin/sh /home/oracle/scripts/db_try.sh

I expect that an “docker stop” will send an SIGTERM and tini will pass this to db_try.sh.

In db_try.sh SIGTERM would be trapped an call gracefulshutdown.
trap gracefulshutdown SIGINT
trap gracefulshutdown SIGTERM
trap gracefulshutdown SIGKILL

However the container does go down without gracefull of the databases.
Can someone give me a helping hand?
THX
Christian