Pārlūkot izejas kodu

Correction of wrong container removal procedure

Vadim Surkov 6 gadi atpakaļ
vecāks
revīzija
e7a0efe44d
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  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\"}}")