Reputation: 318
I need the run a shell script before destroy a docker container.But this script should not work when this container stopped.Only run when i destroy and rm this container.How can i do this?
Upvotes: 1
Views: 965
Reputation: 485
Since it is not possible at the moment, you could use a workaround:
alias "docker-destroy"="<run-script> && docker rm"
For example:
alias "docker-destroy"="echo 'test' && docker rm"
Upvotes: 0
Reputation: 13261
It's not currently possible. Have a look at this issue for more information: https://github.com/docker/docker/issues/6982
Upvotes: 1