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

containers exit early in docker-workflow 1.15

XMLWordPrintable

      After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2:

      stage ('Unit Tests') {
      try {
         dir ("./somewhere/somepath") {
            sh "./somewhere/some.sh"
         }
         def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim()
         image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c ->
            sh "./somewhere/someother.sh"
            junit 'nosetests.xml'
            step([$class: 'CoberturaPublisher',
              /* ... */ ])
            sh "git clean -fdx"
          }
        } finally {
          sh "./somewhere/somefinal.sh || true"
        }
      }

       

      All of the scripts here would run, but somewhere/someother.sh on some jobs would exit early and other jobs (different projects, same format) would complete successfully but still return a -1, such as:

      ERROR: script returned exit code -2

       

      Reverting to docker-workflow 1.14 alleviated the problems.

       

      I started with docker-engine 17.06 running on Debian Stretch and while diagnosing these problems upgraded to docker-ce (17.12.0-ce, build c97c6d6).  Upgrading docker made no difference.

       

            ndeloof Nicolas De Loof
            displague Marques Johansson
            Votes:
            6 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: