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

docker pipeline hangs when global environment variable contains path with spaces

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We've been trying to get scripted pipelines to run steps inside docker images for a while now. Steps like bat, powershell, pswh, etc. would cause the build to hang.

      After a lot of investigation the issue is soo easy to reproduce!
      In Jenkins under "Configure System" > "Global properties" > "Environment variables" we had a variable that contained quotes and a space. Example: "C:\Program Files\Red Gate\SmartAssembly 7\SmartAssembly.com"

      Here's a snippet from our Jenkinsfile:

       

      stage('build') {
          echo "On agent"
          docker.build("${appName}:${env.BUILD_ID}").inside {
              echo "In docker"
              bat 'echo running inside docker' // This will hang the build
          }
      }
      

      (Note: Using docker.image had the same result.)

      Removing the environment variable resolves the issue.

       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            csanchez Carlos Sanchez
            Reporter:
            benbarth Ben
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: