Explorar o código

Correction of wrong container removal procedure

Vadim Surkov %!s(int64=6) %!d(string=hai) anos
pai
achega
e7a0efe44d
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      docker-entrypoint.sh

+ 3 - 3
docker-entrypoint.sh

@@ -1,12 +1,12 @@
 #!/bin/sh
 
-trap cleanup SIGTERM EXIT
+trap cleanup 0 1 2 3 6 15
 
 cleanup()
 {
   echo Terminating $SERVICENAME
-  docker stop $(docker ps -q -f label=ru.sdsys.subcontainer=$SERVICENAME)
-  docker rm -f $(docker ps -q -f label=ru.sdsys.subcontainer=$SERVICENAME)
+#  docker stop $(docker ps -q -f label=ru.sdsys.subcontainer=$SERVICENAME)
+  docker rm -f $(docker ps -a -q -f label=ru.sdsys.subcontainer=$SERVICENAME)
 }
 
 SERVICENAME=$(docker inspect $HOSTNAME -f "{{index .Config.Labels \"com.docker.swarm.service.name\"}}")