Do not kill docker container with SIGKILL

When we will use `kill` command on `docker` main process will receive
`SIGKILL` signal. This will result in immediate termination of
processes. We need to send a signal `SIGTERM` to main process and give
the opportunity to close application in correct way.
This commit is contained in:
Piotr Niełacny
2015-04-28 17:41:48 +02:00
parent 713a8d4f31
commit 4aa970ace8

3
dokku
View File

@@ -91,7 +91,7 @@ case "$1" in
# if we can't post-deploy successfully, kill new container
kill_new() {
docker inspect $id &> /dev/null && docker kill $id > /dev/null
docker inspect $id &> /dev/null && docker stop $id > /dev/null && docker kill $id > /dev/null
trap - INT TERM EXIT
kill -9 $$
}
@@ -120,6 +120,7 @@ case "$1" in
exec >/dev/null 2>/dev/null </dev/null
trap '' INT HUP
sleep $WAIT
docker stop $oldid
docker kill $oldid
) & disown -a
# Use trap since disown/nohup don't seem to keep child alive