• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • docker-slaves-plugin
    • None
    • Jenkins 2.27
      docker-slaves-plugin 1.0.5

      The main slave containers are not removed after job completes...

      # docker ps -a
      CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                       PORTS               NAMES
      61c83a8fd3e2        jenkinsci/slave     "java -Djava.io.tmpdi"   9 minutes ago       Exited (0) 9 minutes ago                         thirsty_ardinghelli
      ffee427d5c00        jenkinsci/slave     "java -Djava.io.tmpdi"   9 minutes ago       Exited (0) 9 minutes ago                         distracted_perlman
      b25cef18c35f        jenkinsci/slave     "java -Djava.io.tmpdi"   10 minutes ago      Exited (0) 9 minutes ago                         nostalgic_meninsky
      2116b508126b        jenkinsci/slave     "java -Djava.io.tmpdi"   19 hours ago        Exited (0) 19 hours ago                          happy_leakey
      bccec6db5efd        jenkinsci/slave     "java -Djava.io.tmpdi"   19 hours ago        Exited (0) 19 hours ago                          tender_ramanujan
      c52ea168536d        jenkinsci/slave     "java -Djava.io.tmpdi"   23 hours ago        Exited (143) 1 seconds ago                       berserk_knuth
      fbf52b0bc679        jenkinsci/slave     "java -Djava.io.tmpdi"   23 hours ago        Exited (0) 23 hours ago                          determined_cori
      ee3b6b237803        jenkinsci/slave     "java -Djava.io.tmpdi"   23 hours ago        Exited (0) 23 hours ago                          drunk_joliot
      a505c09916ad        jenkinsci/slave     "java -Djava.io.tmpdi"   23 hours ago        Exited (0) 23 hours ago                          desperate_lalande
      

          [JENKINS-40019] slave containers are not cleaned up.

          Oh, this is killing us! None of the slaves does not gets cleaned up after build...

          Nikola Svitlica added a comment - Oh, this is killing us! None of the slaves does not gets cleaned up after build...

          This is extremely stupid issue, until it is fixed, quick fix is to add a crontab which would do a cleanup of unwanted containers:

          0 * * * * root docker rm $(docker ps -q -f status=exited -f ancestor=jenkinsci/slave)

          This will remove all exited containers that are jenkin slaves - every hour (you can setup yours as you like)

          Nikola Svitlica added a comment - This is extremely stupid issue, until it is fixed, quick fix is to add a crontab which would do a cleanup of unwanted containers: 0 * * * * root docker rm $(docker ps -q -f status=exited -f ancestor=jenkinsci/slave) This will remove all exited containers that are jenkin slaves - every hour (you can setup yours as you like)

          It would be nice if the corresponded volumes to the exited containers will also be cleaned up.

          Sandra Parsick added a comment - It would be nice if the corresponded volumes to the exited containers will also be cleaned up.

          fixed by 714155ffe1c2d0197cf9b482f62153857a43f4df

          Nicolas De Loof added a comment - fixed by 714155ffe1c2d0197cf9b482f62153857a43f4df

            ndeloof Nicolas De Loof
            agrnwd Andrew Greenwood
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: