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

Wrong mount point spec for Windows Containers in Docker

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      It seems that ":z" volume bind mount flag in docker is not suported for windows containers.

      For jenkinsfile:

      pipeline {
          agent {
              docker { image 'mksondej/aspnet-node-msbuild' }
          }
          stages {
              stage('Test') {
                  steps {
                      powershell 'ls'
                  }
              }
          }
      }

      Here's what my pipeline tries to execute:

       

      docker run -t -d -u 18:18 -w "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA" -v "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z" -v "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA@tmp:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA@tmp:rw,z" -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** mksondej/aspnet-node-msbuild cat
      

       

      and the result is:

       

      java.io.IOException: Failed to run image 'mksondej/aspnet-node-msbuild'. Error: docker: Error response from daemon: invalid bind mount spec "C:\\Program Files (x86)\\Jenkins\\workspace\\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\\Program Files (x86)\\Jenkins\\workspace\\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z": invalid volume specification: 'C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z'
      

      It seems that running windows containers in the pipeline is currently impossible?

      By manually fiddling with the command above I've found out that without ":z" ("rw" can stay) it would work properly. I've tried to make a crude workaround by making a bat cmd somewhere in my PATH which would make a simple string replacement, but it only worked from my or other user's command line. The pipeline seems to run docker.exe directly.

      Any wokaround would be more than welcome, thanks

       

        Attachments

          Issue Links

            Activity

            mksondej Michał Sondej created issue -
            Hide
            besikts Besik Tsitelashvili added a comment -

            ,z and -u as well, does not supported...

             

            Show
            besikts Besik Tsitelashvili added a comment - ,z and -u as well, does not supported...  
            mbloemendal Maikel Bloemendal made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-36776 [ JENKINS-36776 ]

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mksondej Michał Sondej
              Votes:
              7 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated: