Run a script when docker is stopped

Viewed 15195

I am trying to create docker container using dockerfile where script-entry.sh is to be executed when the containers starts and script-exit.sh to be executed when the container stops.

ENTRYPOINT helped to accomplish the first part of the problem where script-entry.sh runs on startup.

How will i make sure the script-exit.sh is executed on docker exit/stop ?

2 Answers
Related