I'm using docker, and I would like to know: Is it possible to send a signal, from a running container to another running container ?
More precisely, I would like to send SIGUSR1 to python program.
I already made a bash script to get pid of my python process and send the signal:
send_signal.sh
#!/bin/bash
py_pid=$(pidof -s python my_programme.py
kill -SIGUSR1 $py_pid
Before, I executed send_signal.sh from Docker host like that:
docker exec docker_with_python bash send_signal.sh
Or simply like that:
docker kill --signal="SIGUSR1 docker_with_python
But now, I would like to send signal to a running container to another one. So, how could I execute this command from another running container. Or is there another way of send a signal ?
Thanks in advance
This is the code I used. It could help someone else:
Previously, in my docker-compose.yml, I shared volumes: