Possibility for a stop command (executed with docker stop)

It would be nice, to execute custom stop commands when a container is stopped instead of sending the kill command to the process.
This commands could be configured in the Dockerfile with e.g.

ENTRYPOINT ["..."]
EXIT ["..."]

This e.g. is needed when the stop should also clear some resources (pid files, …).

It’s still ok to give the stop command 10 seconds (or more if time is specified) before the container is stopped hard.

1 Like