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

Provide way to disable mounting Jenkins workspace

      Currently the Jenkins workspace is always mounted. This might not be desirable in all cases (such as JENKINS-74912). It also prevents users from using their own workdir parameter.

      Provide a way do disable the default mounting of the workspace. Example:

      docker.image('myregistry.com/myrepository/myimage:latest').inside(mountWorkspace=false) {
          bat 'echo test'
      }
      

          [JENKINS-75087] Provide way to disable mounting Jenkins workspace

          Mark R added a comment - - edited

          This might not be possible with the current design. The plugin ends up running a DurableTask which in turn uses a FileMonitoringTask.StatusCheck to track the state of the process launched in docker. This looks for a file in $WORKSPACE@tmp/durable-<some_id>/jenkins-result.txt which normally contains the result of the command run in the container written to by the script $WORKSPACE@tmp/durable-<some_id>/jenkins-wrap.bat. There is a log file and a jenkins-main.bat file that ends up there too.

          Basically at least some type of mount is needed since the durable task plugin uses the filesystem for wrapping launched commands and tracking the launched command log and output. Allowing the user to skip mounting the workspace without ensuring they somehow mount it elsewhere will result in the steps executed in the docker image to hang.

          Mark R added a comment - - edited This might not be possible with the current design. The plugin ends up running a DurableTask which in turn uses a FileMonitoringTask.StatusCheck to track the state of the process launched in docker. This looks for a file in $WORKSPACE@tmp/durable-<some_id>/jenkins-result.txt which normally contains the result of the command run in the container written to by the script $WORKSPACE@tmp/durable-<some_id>/jenkins-wrap.bat. There is a log file and a jenkins-main.bat file that ends up there too. Basically at least some type of mount is needed since the durable task plugin uses the filesystem for wrapping launched commands and tracking the launched command log and output. Allowing the user to skip mounting the workspace without ensuring they somehow mount it elsewhere will result in the steps executed in the docker image to hang.

            Unassigned Unassigned
            mrichar2 Mark R
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: