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

Parallel Docker pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • docker-workflow-plugin
    • None

      docker withRun does not create separate containers when run within a parallel block. The output of the first step is shown in all steps.

      In the following example, "make frontend" fails and its output is repeated in the shell steps of both frontend and backend steps.

      node {
        def runCmd = { cmd ->
              docker.image("ubuntu:latest").withRun("-t -v /home/mn:/src/mn") { c ->
                  sh "docker exec ${c.id} ${cmd}"
              }
          }
        
        stage 'Build'
        runCmd 'npm install'
        parallel (
          "frontend": {
            runCmd "make frontend"
          },
          "backend": {
            runCmd "make backend"
          }
        )
      }
      

            jglick Jesse Glick
            shauvik Shauvik Roy Choudhary
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: