I've a docker-compose.yml which starts several containers. One of which uses a Dockerimage file to install everything needed in that container.
I'd like to add a script which runs each time waiting for the interruption signals 0, 9 and 137.
Now, I'm trying to run the script as an Entrypoint in the Dockerimage file, but doesn't seems to work.
This is the content of the Dockerimage file :
RUN apt-get update && [...]
WORKDIR "/application"
ENTRYPOINT ["/bin/bash", "-c", "/application/scripts/cl.sh"]
Am I doing something wrong? Do I need to rebuild the containers with the following command?
docker-compose build
This is the content of the bash script cl.sh
#!/bin/bash
echo "HELLO HELLO HELLO HELLO"
trap 'echo "Exiting with a 137 signal."' 137 0 9
The only purpose of the script at the moment is testing everything work.
ENTRYPOINT
command of your Dockerfile, the bash option-c
is off-topic and should be removed, because this option is dedicated for passing inline code to bash, not for running an external script. – Publicly