Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37769

Too long stop docker container(default docker stop timeout=10s)

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • docker-workflow-plugin
    • None
    • CloudBees Docker Pipeline 1.7
      Jenkins ver. 2.7

    Description

      Please use docker stop --time 0 when stop container for inside{}
      inside construction generate following cli call

      00:00:55.724 $ docker run -t -d -u 1000:1000 -w ... -v ...:rw -v ...@tmp:rw -e * tag cat
      00:00:56.357 + <shell command>
      00:00:56.369 $ docker stop 
      00:01:06.542 $ docker rm -f 
      

      but docker stop stop this cat command 10 seconds - too long

      docker stop --help
      
      Usage:  docker stop [OPTIONS] CONTAINER [CONTAINER...]
      
      Stop one or more running containers
      
      Options:
            --help       Print usage
        -t, --time int   Seconds to wait for stop before killing it (default 10)
      

      Experiment 1

      $ time docker run -t -d --name test ubuntu cat
      af6c228448ace32c66dba70efa2cc6189bc35dccdb2b950544e2a2e807a1d955
      
      real    0m0.289s
      user    0m0.016s
      sys     0m0.004s
      
      $ time docker stop test
      test
      
      real    0m10.206s
      user    0m0.008s
      sys     0m0.008s
      
      $ time docker rm -f test
      test
      
      real    0m0.021s
      user    0m0.008s
      sys     0m0.008s
      

      Experiment 2

      $ time docker run -t -d --name test ubuntu cat
      5d02979c9928e47455981f162707590122b5b124ec8748740273846201704a17
      
      real    0m0.324s
      user    0m0.008s
      sys     0m0.004s
      
      $ time docker stop --time 0 test
      test
      
      real    0m0.197s
      user    0m0.012s
      sys     0m0.000s
      
      $ time docker rm -f test
      test
      
      real    0m0.020s
      user    0m0.008s
      sys     0m0.004s
      

      Attachments

        Issue Links

          Activity

            t_rex Oleksii Trekhov created issue -
            t_rex Oleksii Trekhov made changes -
            Field Original Value New Value
            Description Please use *docker stop --time 0* when stop container for inside{}
            .inside{ sh '...'} construction generate following cli call

            00:00:55.724 $ docker run -t -d -u 1000:1000 -w ... -v ...:rw -v ...@tmp:rw -e * tag cat
            00:00:56.357 + <shell command>
            00:00:56.369 $ docker stop
            00:01:06.542 $ docker rm -f

            but *docker stop* stop this *cat* command 10 seconds - too long
            {code}
            docker stop --help

            Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]

            Stop one or more running containers

            Options:
                  --help Print usage
              -t, --time int Seconds to wait for stop before killing it (default 10)
            {code}
            Experiment 1
            {code}
            $ time docker run -t -d --name test ubuntu cat
            af6c228448ace32c66dba70efa2cc6189bc35dccdb2b950544e2a2e807a1d955

            real 0m0.289s
            user 0m0.016s
            sys 0m0.004s

            $ time docker stop test
            test

            real 0m10.206s
            user 0m0.008s
            sys 0m0.008s

            $ time docker rm -f test
            test

            real 0m0.021s
            user 0m0.008s
            sys 0m0.008s
            {code}

            Experiment 2
            {code}
            $ time docker run -t -d --name test ubuntu cat
            5d02979c9928e47455981f162707590122b5b124ec8748740273846201704a17

            real 0m0.324s
            user 0m0.008s
            sys 0m0.004s

            $ time docker stop --time 0 test
            test

            real 0m0.197s
            user 0m0.012s
            sys 0m0.000s

            $ time docker rm -f test
            test

            real 0m0.020s
            user 0m0.008s
            sys 0m0.004s
            {code}
            Please use *docker stop --time 0* when stop container for inside{}
            *inside* construction generate following cli call
            {code}
            00:00:55.724 $ docker run -t -d -u 1000:1000 -w ... -v ...:rw -v ...@tmp:rw -e * tag cat
            00:00:56.357 + <shell command>
            00:00:56.369 $ docker stop
            00:01:06.542 $ docker rm -f
            {code}

            but *docker stop* stop this *cat* command 10 seconds - too long
            {code}
            docker stop --help

            Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]

            Stop one or more running containers

            Options:
                  --help Print usage
              -t, --time int Seconds to wait for stop before killing it (default 10)
            {code}
            Experiment 1
            {code}
            $ time docker run -t -d --name test ubuntu cat
            af6c228448ace32c66dba70efa2cc6189bc35dccdb2b950544e2a2e807a1d955

            real 0m0.289s
            user 0m0.016s
            sys 0m0.004s

            $ time docker stop test
            test

            real 0m10.206s
            user 0m0.008s
            sys 0m0.008s

            $ time docker rm -f test
            test

            real 0m0.021s
            user 0m0.008s
            sys 0m0.008s
            {code}

            Experiment 2
            {code}
            $ time docker run -t -d --name test ubuntu cat
            5d02979c9928e47455981f162707590122b5b124ec8748740273846201704a17

            real 0m0.324s
            user 0m0.008s
            sys 0m0.004s

            $ time docker stop --time 0 test
            test

            real 0m0.197s
            user 0m0.012s
            sys 0m0.000s

            $ time docker rm -f test
            test

            real 0m0.020s
            user 0m0.008s
            sys 0m0.004s
            {code}
            t_rex Oleksii Trekhov made changes -
            Summary Stop docker container too long (default docker stop timeout=10s) Too long stop docker container(default docker stop timeout=10s)
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 65 (Web Link)" [ 14830 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            docwhat Christian Höltje made changes -
            Link This issue is related to JENKINS-45888 [ JENKINS-45888 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

            People

              jglick Jesse Glick
              t_rex Oleksii Trekhov
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: