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

docker.image.inside fails unexpectedly with Jenkinsfile

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: docker-workflow-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.651.1 
      CloudBees Docker Pipeline 1.4 
      Pipeline 2.0
      Docker 1.11.0
      RHEL 7.2
    • Similar Issues:

      Description

      With a simple Jenkinsfile when building, at some point it'll fail for no obvious reason.

      An example Jenkinsfile:

      def img = 'centos:7';
      
      node('docker') {
        stage "pulling";
        sh "docker pull ${img}"; // workaround for JENKINS-34288
      
        checkout scm;
      
        docker.image(img).inside {
          sh 'for i in $(seq 30); do sleep 1; echo $i; done';
          sh 'ls -alh --color';
        }
      }
      

      Partial output:

      [Pipeline] Run build steps inside a Docker container : Start
      $ docker run -t -d -u 995:993 -w /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:rw -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** centos:7 cat
      [Pipeline] withDockerContainer {
      [Pipeline] sh
      [master] Running shell script
      ++ seq 30
      + for i in '$(seq 30)'
      + sleep 1
      [Pipeline] } //withDockerContainer
      $ docker stop 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
      $ docker rm -f 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
      [Pipeline] Run build steps inside a Docker container : End
      [Pipeline] } //node
      [Pipeline] Allocate node : End
      [Pipeline] End of Pipeline
      

        Attachments

          Issue Links

            Activity

            docwhat Christian Höltje created issue -
            docwhat Christian Höltje made changes -
            Field Original Value New Value
            Description With a simple {{Jenkinsfile}} when building, at some point it'll fail for no obvious reason.

            An example {{Jenkinsfile}}:

            {{
            def img = 'centos:7';

            node('docker') {
              stage "pulling";
              sh "docker pull ${img}"; // workaround for JENKINS-34288

              checkout scm;

              docker.image(img).inside {
                sh 'for i in $(seq 30); do sleep 1; echo $i; done';
                sh 'ls -alh --color';
              }
            }
            def img = 'centos:7';

            node('docker') {
              stage "pulling";
              sh "docker pull ${img}"; // workaround for JENKINS-34288

              checkout scm;

              docker.image(img).inside {
                sh 'for i in $(seq 30); do sleep 1; echo $i; done';
                sh 'ls -alh --color';
              }
            }
            }}

            Partial output:

            {{
            [Pipeline] Run build steps inside a Docker container : Start
            $ docker run -t -d -u 995:993 -w /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:rw -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** centos:7 cat
            [Pipeline] withDockerContainer {
            [Pipeline] sh
            [master] Running shell script
            ++ seq 30
            + for i in '$(seq 30)'
            + sleep 1
            [Pipeline] } //withDockerContainer
            $ docker stop 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            $ docker rm -f 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            [Pipeline] Run build steps inside a Docker container : End
            [Pipeline] } //node
            [Pipeline] Allocate node : End
            [Pipeline] End of Pipeline
            }}
            With a simple {{Jenkinsfile}} when building, at some point it'll fail for no obvious reason.

            An example {{Jenkinsfile}}:

            {code:groovy}
            def img = 'centos:7';

            node('docker') {
              stage "pulling";
              sh "docker pull ${img}"; // workaround for JENKINS-34288

              checkout scm;

              docker.image(img).inside {
                sh 'for i in $(seq 30); do sleep 1; echo $i; done';
                sh 'ls -alh --color';
              }
            }
            {code}

            Partial output:

            {noformat}
            [Pipeline] Run build steps inside a Docker container : Start
            $ docker run -t -d -u 995:993 -w /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:rw -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** centos:7 cat
            [Pipeline] withDockerContainer {
            [Pipeline] sh
            [master] Running shell script
            ++ seq 30
            + for i in '$(seq 30)'
            + sleep 1
            [Pipeline] } //withDockerContainer
            $ docker stop 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            $ docker rm -f 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            [Pipeline] Run build steps inside a Docker container : End
            [Pipeline] } //node
            [Pipeline] Allocate node : End
            [Pipeline] End of Pipeline
            {noformat}
            docwhat Christian Höltje made changes -
            Description With a simple {{Jenkinsfile}} when building, at some point it'll fail for no obvious reason.

            An example {{Jenkinsfile}}:

            {code:groovy}
            def img = 'centos:7';

            node('docker') {
              stage "pulling";
              sh "docker pull ${img}"; // workaround for JENKINS-34288

              checkout scm;

              docker.image(img).inside {
                sh 'for i in $(seq 30); do sleep 1; echo $i; done';
                sh 'ls -alh --color';
              }
            }
            {code}

            Partial output:

            {noformat}
            [Pipeline] Run build steps inside a Docker container : Start
            $ docker run -t -d -u 995:993 -w /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:rw -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** centos:7 cat
            [Pipeline] withDockerContainer {
            [Pipeline] sh
            [master] Running shell script
            ++ seq 30
            + for i in '$(seq 30)'
            + sleep 1
            [Pipeline] } //withDockerContainer
            $ docker stop 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            $ docker rm -f 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            [Pipeline] Run build steps inside a Docker container : End
            [Pipeline] } //node
            [Pipeline] Allocate node : End
            [Pipeline] End of Pipeline
            {noformat}
            With a simple {{Jenkinsfile}} when building, at some point it'll fail for no obvious reason.

            An example {{Jenkinsfile}}:

            {code:java}
            def img = 'centos:7';

            node('docker') {
              stage "pulling";
              sh "docker pull ${img}"; // workaround for JENKINS-34288

              checkout scm;

              docker.image(img).inside {
                sh 'for i in $(seq 30); do sleep 1; echo $i; done';
                sh 'ls -alh --color';
              }
            }
            {code}

            Partial output:

            {noformat}
            [Pipeline] Run build steps inside a Docker container : Start
            $ docker run -t -d -u 995:993 -w /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master:rw -v /var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:/var/lib/jenkins/workspace/tron/docwhat-test-jenkinsfile/master@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** centos:7 cat
            [Pipeline] withDockerContainer {
            [Pipeline] sh
            [master] Running shell script
            ++ seq 30
            + for i in '$(seq 30)'
            + sleep 1
            [Pipeline] } //withDockerContainer
            $ docker stop 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            $ docker rm -f 7fcbfd6ab39cf05257a43a774bd20b670bc39674a2047777fe603ee1a3162b10
            [Pipeline] Run build steps inside a Docker container : End
            [Pipeline] } //node
            [Pipeline] Allocate node : End
            [Pipeline] End of Pipeline
            {noformat}
            docwhat Christian Höltje made changes -
            Environment Jenkins 1.651.1 
            CloudBees Docker Pipeline 1.4 
            Pipeline 2.0
            Jenkins 1.651.1 
            CloudBees Docker Pipeline 1.4 
            Pipeline 2.0
            Docker 1.11.0
            RHEL 7.2
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-workflow PR 25 (Web Link)" [ 14223 ]
            docwhat Christian Höltje made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 170357 ] JNJira + In-Review [ 198849 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            jglick Jesse Glick made changes -
            Resolution Cannot Reproduce [ 5 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            kerrhome Shannon Kerr made changes -
            Link This issue is related to JENKINS-46545 [ JENKINS-46545 ]
            leedega Kevin Phillips made changes -
            Link This issue relates to JENKINS-46969 [ JENKINS-46969 ]
            iceiceice Alexey Grigorov made changes -
            Link This issue is related to JENKINS-47822 [ JENKINS-47822 ]

              People

              Assignee:
              jglick Jesse Glick
              Reporter:
              docwhat Christian Höltje
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: