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

Docker Pipeline: invalid volume specification with Windows slave and Linux master

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

      I am unable to build Dockerfile on Windows Server 2016 Jenkins slave (with Docker for Windows). docker build fails with:

      java.io.IOException: Failed to run image '104eec833e514b379b133b127e5336f140417588'. Error: docker: Error response from daemon: invalid bind mount spec "C:\\Jenkins\\workspace\\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\\Jenkins\\workspace\\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z": invalid volume specification: 'C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z'.
      

      Shouldn't Docker volumes on Windows be specified with /c/Jenkins/x/y/z instead of C:\\Jenkins\x\y\z to avoid colon in mount spec?

      Please note, Jenkins master is Linux.

      Jenkinsfile:

      pipeline {
          agent { dockerfile true }
          stages {
              stage("bat") {
                  steps {
                      bat 'echo success'
                  }
              }
          }
      }
      

      pipeline.log:

      Branch indexing
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to <GIT-SERVER>:jenkins-dummy-windows.git
       > git config remote.origin.url <GIT-SERVER>:jenkins-dummy-windows.git # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
      using GIT_SSH to set credentials
       > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
      Seen branch in repository origin/dockerfile
      Seen branch in repository origin/master
      Seen 2 remote branches
      Obtained Jenkinsfile from b0ad1e07cc6644cd1aaa5c3d9df7ee4055063c76
      [Pipeline] node
      Running on jenkins-slave-windows-20171212-1307 (<INSTANCE-ID>) in C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Checkout SCM)
      [Pipeline] checkout
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url <GIT-SERVER>:jenkins-dummy-windows.git # timeout=10
      Fetching without tags
      Fetching upstream changes from <GIT-SERVER>:jenkins-dummy-windows.git
       > git --version # timeout=10
      using GIT_SSH to set credentials
       > git fetch --no-tags --progress <GIT-SERVER>:jenkins-dummy-windows.git +refs/heads/*:refs/remotes/origin/*
      Checking out Revision b0ad1e07cc6644cd1aaa5c3d9df7ee4055063c76 (dockerfile)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f b0ad1e07cc6644cd1aaa5c3d9df7ee4055063c76
      Commit message: "Dockerfile: microsoft/nanoserver"
       > git rev-list 72d5471c47515615bf39bb5a20cf9727298ccd98 # timeout=10
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Agent Setup)
      [Pipeline] readFile
      [Pipeline] sh
      [C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q] Running shell script
      + docker build -t 104eec833e514b379b133b127e5336f140417588 -f Dockerfile .
      Sending build context to Docker daemon  77.31kB
      
      Step 1/4 : FROM microsoft/nanoserver
      latest: Pulling from microsoft/nanoserver
      bce2fbc256ea: Pulling fs layer
      53a0ccfb7e6f: Pulling fs layer
      53a0ccfb7e6f: Verifying Checksum
      53a0ccfb7e6f: Download complete
      bce2fbc256ea: Verifying Checksum
      bce2fbc256ea: Download complete
      bce2fbc256ea: Pull complete
      53a0ccfb7e6f: Pull complete
      Digest: sha256:df59b79514786730283cd2df9dbcfdde086454cdbcefbe5e90e142f4d2e97d25
      Status: Downloaded newer image for microsoft/nanoserver:latest
       ---> edc711fca788
      Step 2/4 : MAINTAINER ops@example.com
       ---> Running in 1869201c58f3
       ---> 5a7da3821076
      Removing intermediate container 1869201c58f3
      Step 3/4 : ADD provision.ps1 /provision.ps1
       ---> fee55580b56f
      Removing intermediate container 9246006875f0
      Step 4/4 : CMD powershell.exe -executionpolicy bypass c:\provision.ps1
       ---> Running in 36b8442d6423
       ---> d2217a5a4ed9
      Removing intermediate container 36b8442d6423
      Successfully built d2217a5a4ed9
      Successfully tagged 104eec833e514b379b133b127e5336f140417588:latest
      [Pipeline] dockerFingerprintFrom
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] sh
      [C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q] Running shell script
      + docker inspect -f . 104eec833e514b379b133b127e5336f140417588
      .
      [Pipeline] withDockerContainer
      jenkins-slave-windows-20171212-1307 (<INSTANCE-ID>) does not seem to be running inside a container
      $ docker run -t -d -u 197108:197121 -w C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@tmp:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat 104eec833e514b379b133b127e5336f140417588
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      java.io.IOException: Failed to run image '104eec833e514b379b133b127e5336f140417588'. Error: docker: Error response from daemon: invalid bind mount spec "C:\\Jenkins\\workspace\\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\\Jenkins\\workspace\\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z": invalid volume specification: 'C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z'.
      See 'docker run --help'.
      	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.run(DockerClient.java:138)
      	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:184)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
      	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/var/lib/jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:128)
      	at org.jenkinsci.plugins.docker.workflow.Docker.node(jar:file:/var/lib/jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:63)
      	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/var/lib/jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:116)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.DockerPipelineFromDockerfileScript.runImage(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy:62)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.AbstractDockerPipelineScript.configureRegistry(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy:68)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.AbstractDockerPipelineScript.run(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy:54)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.agent.CheckoutScript.checkoutAndRun(jar:file:/var/lib/jenkins/plugins/pipeline-model-extensions/WEB-INF/lib/pipeline-model-extensions.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/agent/CheckoutScript.groovy:60)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
      	at sun.reflect.GeneratedMethodAccessor344.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:331)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:243)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:231)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
      

      System properties:

      awt.toolkit	sun.awt.X11.XToolkit
      com.sun.akuma.Daemon	daemonized
      executable-war	/usr/lib/jenkins/jenkins.war
      file.encoding	UTF-8
      file.encoding.pkg	sun.io
      file.separator	/
      hudson.matrix.MatrixConfiguration.useShortWorkspaceName	true
      java.awt.graphicsenv	sun.awt.X11GraphicsEnvironment
      java.awt.headless	true
      java.awt.printerjob	sun.print.PSPrinterJob
      java.class.path	/usr/lib/jenkins/jenkins.war
      java.class.version	52.0
      java.endorsed.dirs	/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/endorsed
      java.ext.dirs	/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
      java.home	/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre
      java.io.tmpdir	/tmp
      java.library.path	/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
      java.runtime.name	OpenJDK Runtime Environment
      java.runtime.version	1.8.0_151-b12
      java.specification.name	Java Platform API Specification
      java.specification.vendor	Oracle Corporation
      java.specification.version	1.8
      java.vendor	Oracle Corporation
      java.vendor.url	http://java.oracle.com/
      java.vendor.url.bug	http://bugreport.sun.com/bugreport/
      java.version	1.8.0_151
      java.vm.info	mixed mode
      java.vm.name	OpenJDK 64-Bit Server VM
      java.vm.specification.name	Java Virtual Machine Specification
      java.vm.specification.vendor	Oracle Corporation
      java.vm.specification.version	1.8
      java.vm.vendor	Oracle Corporation
      java.vm.version	25.151-b12
      jenkins.ec2.bootstrapAuthSleepMs	60000
      JENKINS_HOME	/var/lib/jenkins
      jna.loaded	true
      jna.platform.library.path	/usr/lib64:/lib64:/usr/lib:/lib:/usr/lib64/mysql:/usr/lib64/tcl8.5
      jnidispatch.path	/tmp/jna--1712433994/jna4115920352828623528.tmp
      line.separator
      mail.smtp.sendpartial	true
      mail.smtps.sendpartial	true
      os.arch	amd64
      os.name	Linux
      os.version	2.6.32-696.16.1.el6.x86_64
      path.separator	:
      sun.arch.data.model	64
      sun.boot.class.path	/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/classes
      sun.boot.library.path	/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64
      sun.cpu.endian	little
      sun.cpu.isalist
      sun.font.fontmanager	sun.awt.X11FontManager
      sun.io.unicode.encoding	UnicodeLittle
      sun.java.command	/usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --httpListenAddress=127.0.0.1 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
      sun.java.launcher	SUN_STANDARD
      sun.jnu.encoding	UTF-8
      sun.management.compiler	HotSpot 64-Bit Tiered Compilers
      sun.os.patch.level	unknown
      user.country	US
      user.dir	/
      user.home	/var/lib/jenkins
      user.language	en
      user.name	jenkins
      user.timezone	UTC
      

      Plugins:

      ace-editor	1.1	true
      ansicolor	0.5.2	true
      ant	1.7	true
      antisamy-markup-formatter	1.5	true
      apache-httpcomponents-client-4-api	4.5.3-2.0	true
      authentication-tokens	1.3	true
      aws-credentials	1.23	true
      aws-java-sdk	1.11.226	true
      bitbucket	1.1.8	true
      blueocean	1.3.4	true
      blueocean-autofavorite	1.2.1	true
      blueocean-bitbucket-pipeline	1.3.4	true
      blueocean-commons	1.3.4	true
      blueocean-config	1.3.4	true
      blueocean-dashboard	1.3.4	true
      blueocean-display-url	2.2.0	true
      blueocean-events	1.3.4	true
      blueocean-git-pipeline	1.3.4	true
      blueocean-github-pipeline	1.3.4	true
      blueocean-i18n	1.3.4	true
      blueocean-jira	1.3.4	true
      blueocean-jwt	1.3.4	true
      blueocean-personalization	1.3.4	true
      blueocean-pipeline-api-impl	1.3.4	true
      blueocean-pipeline-editor	1.3.4	true
      blueocean-pipeline-scm-api	1.3.4	true
      blueocean-rest	1.3.4	true
      blueocean-rest-impl	1.3.4	true
      blueocean-web	1.3.4	true
      bouncycastle-api	2.16.2	true
      branch-api	2.0.16	true
      build-timeout	1.19	true
      cloudbees-bitbucket-branch-source	2.2.7	true
      cloudbees-folder	6.2.1	true
      command-launcher	1.2	true
      conditional-buildstep	1.3.6	true
      copyartifact	1.39	true
      credentials	2.1.16	true
      credentials-binding	1.13	true
      display-url-api	2.2.0	true
      docker-commons	1.9	true
      docker-custom-build-environment	1.6.5	true
      docker-workflow	1.14	true
      durable-task	1.17	true
      ec2	1.38	true
      email-ext	2.61	true
      external-monitor-job	1.7	true
      favorite	2.3.1	true
      git	3.6.4	true
      git-client	2.6.0	true
      git-parameter	0.9.0	true
      git-server	1.7	true
      github	1.28.1	true
      github-api	1.90	true
      github-branch-source	2.3.1	true
      github-organization-folder	1.6	true
      greenballs	1.15	true
      handlebars	1.1.1	true
      htmlpublisher	1.14	true
      icon-shim	2.0.3	true
      jackson2-api	2.8.7.0	true
      javadoc	1.4	true
      jira	2.5	true
      jquery	1.12.4-0	true
      jquery-detached	1.2.1	true
      jsch	0.1.54.1	true
      junit	1.23	true
      ldap	1.18	true
      locale	1.2	true
      mailer	1.20	true
      matrix-auth	2.2	true
      matrix-project	1.12	true
      maven-plugin	3.0	true
      mercurial	2.2	true
      metrics	3.1.2.10	true
      momentjs	1.1.1	true
      node-iterator-api	1.5.0	true
      pam-auth	1.3	true
      parameterized-trigger	2.35.2	true
      pipeline-build-step	2.6	true
      pipeline-github-lib	1.0	true
      pipeline-graph-analysis	1.5	true
      pipeline-input-step	2.8	true
      pipeline-milestone-step	1.3.1	true
      pipeline-model-api	1.2.5	true
      pipeline-model-declarative-agent	1.1.1	true
      pipeline-model-definition	1.2.5	true
      pipeline-model-extensions	1.2.5	true
      pipeline-rest-api	2.9	true
      pipeline-stage-step	2.3	true
      pipeline-stage-tags-metadata	1.2.5	true
      pipeline-stage-view	2.9	true
      pipeline-utility-steps	1.5.1	true
      plain-credentials	1.4	true
      publish-over-ssh	1.17	true
      pubsub-light	1.12	true
      resource-disposer	0.8	true
      role-strategy	2.6.1	true
      run-condition	1.0	true
      scm-api	2.2.5	true
      script-security	1.36	true
      simple-theme-plugin	0.3	true
      slack	2.3	true
      sse-gateway	1.15	true
      ssh	2.5	true
      ssh-agent	1.15	true
      ssh-credentials	1.13	true
      ssh-slaves	1.22	true
      structs	1.10	true
      timestamper	1.8.8	true
      token-macro	2.3	true
      variant	1.1	true
      windows-slaves	1.3.1	true
      workflow-aggregator	2.5	true
      workflow-api	2.24	true
      workflow-basic-steps	2.6	true
      workflow-cps	2.42	true
      workflow-cps-global-lib	2.9	true
      workflow-durable-task-step	2.17	true
      workflow-job	2.16	true
      workflow-multibranch	2.16	true
      workflow-scm-step	2.6	true
      workflow-step-api	2.14	true
      workflow-support	2.16	true
      ws-cleanup	0.34	true
      xunit	1.102	true
      

      Environment variables:

      HOME	/var/lib/jenkins
      LANG	en_US.UTF-8
      LOGNAME	jenkins
      NLSPATH	/usr/dt/lib/nls/msg/%L/%N.cat
      PATH	/sbin:/usr/sbin:/bin:/usr/bin
      PWD	/
      SHELL	/bin/bash
      SHLVL	3
      TERM	xterm-256color
      USER	jenkins
      XFILESEARCHPATH	/usr/dt/app-defaults/%L/Dt
      

      Docker for Windows (Jenkins slave) version:

      Client:
       Version:      17.06.2-ee-6
       API version:  1.30
       Go version:   go1.8.3
       Git commit:   e75fdb8
       Built:        Mon Nov 27 22:46:09 2017
       OS/Arch:      windows/amd64
      
      Server:
       Version:      17.06.2-ee-6
       API version:  1.30 (minimum version 1.24)
       Go version:   go1.8.3
       Git commit:   e75fdb8
       Built:        Mon Nov 27 22:55:16 2017
       OS/Arch:      windows/amd64
       Experimental: false
      

      Docker for Windows (Jenkins slave) docker info:

      Containers: 0
       Running: 0
       Paused: 0
       Stopped: 0
      Images: 0
      Server Version: 17.06.2-ee-6
      Storage Driver: windowsfilter
       Windows: 
      Logging Driver: json-file
      Plugins: 
       Volume: local
       Network: l2bridge l2tunnel nat null overlay transparent
       Log: awslogs etwlogs fluentd json-file logentries splunk syslog
      Swarm: inactive
      Default Isolation: process
      Kernel Version: 10.0 14393 (14393.1794.amd64fre.rs1_release.171008-1615)
      Operating System: Windows Server 2016 Datacenter
      OSType: windows
      Architecture: x86_64
      CPUs: 2
      Total Memory: 8GiB
      Name: EC2AMAZ-5SMDP5M
      ID: UV46:JBFH:35OY:6DNJ:G7JW:EH4H:D5B4:YN6P:SR4E:XBNF:3VFA:AB7K
      Docker Root Dir: C:\ProgramData\docker
      Debug Mode (client): false
      Debug Mode (server): false
      Registry: https://index.docker.io/v1/
      Experimental: false
      Insecure Registries:
       127.0.0.0/8
      Live Restore Enabled: false
      

          [JENKINS-48518] Docker Pipeline: invalid volume specification with Windows slave and Linux master

          Todd Morrison added a comment - - edited

          C:\ path should work fine. This issue might be related to the argument order.

           

          Reports original post cites:

          docker run -t -d -u 197108:197121 -w C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@tmp:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat 104eec833e514b379b133b127e5336f140417588

           

          But, if you move the container tag before the port binding, things work as expected:

          docker run -t -d 104eec833e514b379b133b127e5336f140417588 -u 197108:197121 -w C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@tmp:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat
           

          Todd Morrison added a comment - - edited C:\ path should work fine. This issue might be related to the argument order.   Reports original post cites: docker run -t -d -u 197108:197121 -w C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@tmp:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat 104eec833e514b379b133b127e5336f140417588   But, if you move the container tag before the port binding, things work as expected: docker run -t -d 104eec833e514b379b133b127e5336f140417588 -u 197108:197121 -w C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@tmp:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q@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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat  

          Jesse Glick added a comment -

          I no longer work on this plugin.

          The error is not surprising in that there is no attempt to support Docker on Windows, only on Linux.

          Jesse Glick added a comment - I no longer work on this plugin. The error is not surprising in that there is no attempt to support Docker on Windows, only on Linux.

          Björn Bur added a comment -

          I have the same problem. Are there any news?

          Björn Bur added a comment - I have the same problem. Are there any news?

          Hallo,

          I was wondering why it was not working and I have found the following.

          C:\ path doesn't work with a Linux Docker Host because a docker run -v option is waiting a path on the host as the first field. See

          definition in the doc

           

          Because my host is a linux system (boot2docker), it expects a Linux path.

          This is working for me when I configured my virtual box shared drive to mount `c:\` on the host.
           

          docker run -it --rm -v /c/users:/pathInContainer/  ubuntu bash
          

           

          Is there a way to get the Windows path processed through an utility such as cygpath (or something similar) before execution ?

          Thanks 

           

          Nicolas GERARD added a comment - Hallo, I was wondering why it was not working and I have found the following. C:\ path doesn't work with a Linux Docker Host because a docker run -v option is waiting a path on the host as the first field. See definition in the doc   Because my host is a linux system (boot2docker), it expects a Linux path. This is working for me when I configured my virtual box shared drive to mount `c:\` on the host.   docker run -it --rm -v /c/users:/pathInContainer/  ubuntu bash   Is there a way to get the Windows path processed through an utility such as cygpath (or something similar) before execution ? Thanks   

          ... -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z
          

          According to my research the problem isn't the C: filepath, as windows has no Problems working with it, but the "z" flag at the end!

           

          When I remove that flag and run the docker command like it's given in the Jenkins Log everything works fine, but when you add the z flag (even when it's the only one) it makes the path description invalid for Docker on windows. I currently don't have a linux machine not running SELinux on hand to test it on other Linux derivates, but I think this flag shouldn't always be added to the volume specification.

          Raphael Höser added a comment - ... -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z According to my research the problem isn't the C: filepath, as windows has no Problems working with it, but the "z" flag at the end!   When I remove that flag and run the docker command like it's given in the Jenkins Log everything works fine, but when you add the z flag (even when it's the only one) it makes the path description invalid for Docker on windows. I currently don't have a linux machine not running SELinux on hand to test it on other Linux derivates, but I think this flag shouldn't always be added to the volume specification.

          Calin Pavel added a comment -

          Indeed, the problem is generated by extra flag "z" added for volumes. 

          This is added in DockerClient class:

          for (Map.Entry<String, String> volume : volumes.entrySet())

          { argb.add("-v", volume.getKey() + ":" + volume.getValue() + ":rw,z"); }

          Calin Pavel added a comment - Indeed, the problem is generated by extra flag "z" added for volumes.  This is added in DockerClient class: for (Map.Entry<String, String> volume : volumes.entrySet()) { argb.add("-v", volume.getKey() + ":" + volume.getValue() + ":rw,z"); }

          I also just hit this. Did anyone find a workaround?

          Larry Silverman added a comment - I also just hit this. Did anyone find a workaround?

          lsilverman Sadly not really - the github issue had some ideas with writing libraries, which call the docker commands directly, but that doesn't provide the same feature set. Maybe it is possible to use a kubernetes cluster to use docker on windows. (We switched to jenkins in kubernetes, but we also now use wine in the most part with linux hosts)

          Raphael Höser added a comment - lsilverman Sadly not really - the github issue had some ideas with writing libraries, which call the docker commands directly, but that doesn't provide the same feature set. Maybe it is possible to use a kubernetes cluster to use docker on windows. (We switched to jenkins in kubernetes, but we also now use wine in the most part with linux hosts)

          a b added a comment - - edited

          We are also running into the same issue and can confirm that removing the ",z" portion resolves the "invalid volume specification" error

          Running Windows Server 2016 with Docker 19.03.2, build c92ab06ed9 (CLI only not the Docker Desktop app).

          How can we go about resolving this issue for nodes with a Windows host OS? I love and much prefer Linux but sadly we have developer requirements on the Windows side and have to support it in our pipelines.

          EDIT: I'm going to assume this concept is dead in the water based on this thread.. I have browsed through the source and it's riddled with Linux specific commands for interacting with docker and there seems to be zero appetite for making it Windows compatible.
          https://issues.jenkins-ci.org/browse/JENKINS-36776

          We are going to attempt to use the alternate docker-plugin which interacts directly with the Docker Engine API on the host and thus should be more host OS agnostic, though there might be more quirks there too. TBD. The immediate downside is there doesn't seem to be support for Dockerfile files and the images have be be pre-build and pre-defined in the plugin UI under Configure > Cloud > Docker which is odd and kind of ridiculous since this moves away from CI/CD philosophies I'd argue and move programmable features into a UI. Sad.

          EDIT 2: Some kind soul has submitted a PR that resolves this. I build, installed, and tested it this morning with a simple hello world style declarative pipeline on Linux and Windows and it works. Fingers crossed this will make it to prime time soon.
          https://github.com/jenkinsci/docker-workflow-plugin/pull/183

          a b added a comment - - edited We are also running into the same issue and can confirm that removing the ",z" portion resolves the "invalid volume specification" error Running Windows Server 2016 with Docker 19.03.2, build c92ab06ed9 (CLI only not the Docker Desktop app). How can we go about resolving this issue for nodes with a Windows host OS? I love and much prefer Linux but sadly we have developer requirements on the Windows side and have to support it in our pipelines. EDIT : I'm going to assume this concept is dead in the water based on this thread.. I have browsed through the source and it's riddled with Linux specific commands for interacting with docker and there seems to be zero appetite for making it Windows compatible. https://issues.jenkins-ci.org/browse/JENKINS-36776 We are going to attempt to use the alternate docker-plugin which interacts directly with the Docker Engine API on the host and thus should be more host OS agnostic, though there might be more quirks there too. TBD. The immediate downside is there doesn't seem to be support for Dockerfile files and the images have be be pre-build and pre-defined in the plugin UI under Configure > Cloud > Docker which is odd and kind of ridiculous since this moves away from CI/CD philosophies I'd argue and move programmable features into a UI. Sad. EDIT 2 : Some kind soul has submitted a PR that resolves this. I build, installed, and tested it this morning with a simple hello world style declarative pipeline on Linux and Windows and it works. Fingers crossed this will make it to prime time soon. https://github.com/jenkinsci/docker-workflow-plugin/pull/183

            Unassigned Unassigned
            sslppg PZG
            Votes:
            13 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: