-
Improvement
-
Resolution: Unresolved
-
Minor
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' }
- relates to
-
JENKINS-74912 Jenkins docker-image plugin does not work with non-C windows drives
-
- Open
-
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.