I am trying to make a container that saves data to a folder on the container linking to the host os on exit.
However, it doesn’t trigger the trapped command.
This is the ENTRYPOINT format of the Dockerfile:
ENTRYPOINT ["/bin/bash","start.sh"]
And this is start.sh:
trap 'echo "replace with command that saves data"' SIGTERM
java -jar program.jar
However, it doesn’t catch the signal at all.
Keep in mind I am trying to let start.sh recieve the signal and save data, not the program.