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

Jenkins docker-image plugin does not work with non-C windows drives

      If the workspace is on a different drive (in this case N) then docker.image fails with something like this:

      docker.image('myregistry.com/myrepository/myimage:latest').inside {
          sh 'echo test'
      }
      
      00:00:07.112  $ docker run -d -t -w N:/myworkspace/myjob -v N:/myworkspace/myjob/:N:/myworkspace/myjob/ -v N:/myworkspace/myjob@tmp/:N:/myworkspace/myjob@tmp/ -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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** myregistry.com/myrepository/myimage:latest cmd.exe
      . . .
      00:00:08.850  java.io.IOException: Failed to run image 'myregistry.com/myrepository/myimage:latest'. Error: docker: Error response from daemon: hcs::CreateComputeSystem aa1593a84f9df2613191e56fa1b8037bd6d27a4b2c932a1b33e8b6e7f74961d0: The parameter is incorrect.
      

      This is due to a limitation in docker on Windows:

      Volumes on Windows-based containers: When using Windows-based containers, the destination of a volume inside the container must be one of:
      
      a non-existing or empty directory
      a drive other than C:
      

      documentation and documentation

      See https://github.com/moby/moby/issues/41681

      The Jenkins docker-image plugin should be updated to either:
      1) fail/warn in this case
      2) provide a way to configure the mount
      3) mount non-C paths to C inside the container. Any variables that reference the non-C drive may need to be updated to use the C drive

          [JENKINS-74912] Jenkins docker-image plugin does not work with non-C windows drives

          Mark R created issue -
          Mark R made changes -
          Description Original: If the workspace is on a different drive (in this case N) then docker.image fails with something like this:

          {noformat}
          00:00:07.112 $ docker run -d -t -w N:/myworkspace/myjob -v N:/myworkspace/myjob/:N:/myworkspace/myjob/ -v N:/myworkspace/myjob@tmp/:N:/myworkspace/myjob@tmp/ -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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** myregistry.com/myrepository/myimage:latest cmd.exe
          . . .
          00:00:08.850 java.io.IOException: Failed to run image 'myregistry.com/myrepository/myimage:latest'. Error: docker: Error response from daemon: hcs::CreateComputeSystem aa1593a84f9df2613191e56fa1b8037bd6d27a4b2c932a1b33e8b6e7f74961d0: The parameter is incorrect.
          {noformat}

          This is due to a limitation in docker on Windows:

          {noformat}
          Volumes on Windows-based containers: When using Windows-based containers, the destination of a volume inside the container must be one of:

          a non-existing or empty directory
          a drive other than C:
          {noformat}

          [documentation](https://docs.docker.com/reference/dockerfile/#notes-about-specifying-volumes)

          See https://github.com/moby/moby/issues/41681

          The Jenkins docker-image plugin should be updated to either:
          1) fail/warn in this case
          2) provide a way to configure the mount
          3) mount non-C paths to C inside the container. Any variables that reference the non-C drive may need to be updated to use the C drive




          New: If the workspace is on a different drive (in this case N) then docker.image fails with something like this:

          {noformat}
          00:00:07.112 $ docker run -d -t -w N:/myworkspace/myjob -v N:/myworkspace/myjob/:N:/myworkspace/myjob/ -v N:/myworkspace/myjob@tmp/:N:/myworkspace/myjob@tmp/ -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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** myregistry.com/myrepository/myimage:latest cmd.exe
          . . .
          00:00:08.850 java.io.IOException: Failed to run image 'myregistry.com/myrepository/myimage:latest'. Error: docker: Error response from daemon: hcs::CreateComputeSystem aa1593a84f9df2613191e56fa1b8037bd6d27a4b2c932a1b33e8b6e7f74961d0: The parameter is incorrect.
          {noformat}

          This is due to a limitation in docker on Windows:

          {noformat}
          Volumes on Windows-based containers: When using Windows-based containers, the destination of a volume inside the container must be one of:

          a non-existing or empty directory
          a drive other than C:
          {noformat}

          [documentation|https://docs.docker.com/reference/dockerfile/#notes-about-specifying-volumes]

          See https://github.com/moby/moby/issues/41681

          The Jenkins docker-image plugin should be updated to either:
          1) fail/warn in this case
          2) provide a way to configure the mount
          3) mount non-C paths to C inside the container. Any variables that reference the non-C drive may need to be updated to use the C drive




          Mark R made changes -
          Description Original: If the workspace is on a different drive (in this case N) then docker.image fails with something like this:

          {noformat}
          00:00:07.112 $ docker run -d -t -w N:/myworkspace/myjob -v N:/myworkspace/myjob/:N:/myworkspace/myjob/ -v N:/myworkspace/myjob@tmp/:N:/myworkspace/myjob@tmp/ -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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** myregistry.com/myrepository/myimage:latest cmd.exe
          . . .
          00:00:08.850 java.io.IOException: Failed to run image 'myregistry.com/myrepository/myimage:latest'. Error: docker: Error response from daemon: hcs::CreateComputeSystem aa1593a84f9df2613191e56fa1b8037bd6d27a4b2c932a1b33e8b6e7f74961d0: The parameter is incorrect.
          {noformat}

          This is due to a limitation in docker on Windows:

          {noformat}
          Volumes on Windows-based containers: When using Windows-based containers, the destination of a volume inside the container must be one of:

          a non-existing or empty directory
          a drive other than C:
          {noformat}

          [documentation|https://docs.docker.com/reference/dockerfile/#notes-about-specifying-volumes]

          See https://github.com/moby/moby/issues/41681

          The Jenkins docker-image plugin should be updated to either:
          1) fail/warn in this case
          2) provide a way to configure the mount
          3) mount non-C paths to C inside the container. Any variables that reference the non-C drive may need to be updated to use the C drive




          New: If the workspace is on a different drive (in this case N) then docker.image fails with something like this:

          {noformat}
          00:00:07.112 $ docker run -d -t -w N:/myworkspace/myjob -v N:/myworkspace/myjob/:N:/myworkspace/myjob/ -v N:/myworkspace/myjob@tmp/:N:/myworkspace/myjob@tmp/ -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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** myregistry.com/myrepository/myimage:latest cmd.exe
          . . .
          00:00:08.850 java.io.IOException: Failed to run image 'myregistry.com/myrepository/myimage:latest'. Error: docker: Error response from daemon: hcs::CreateComputeSystem aa1593a84f9df2613191e56fa1b8037bd6d27a4b2c932a1b33e8b6e7f74961d0: The parameter is incorrect.
          {noformat}

          This is due to a limitation in docker on Windows:

          {noformat}
          Volumes on Windows-based containers: When using Windows-based containers, the destination of a volume inside the container must be one of:

          a non-existing or empty directory
          a drive other than C:
          {noformat}

          [documentation|https://docs.docker.com/reference/dockerfile/#notes-about-specifying-volumes] and [documentation|https://docs.docker.com/reference/cli/docker/container/run/#mount-volume--v---read-only]

          See https://github.com/moby/moby/issues/41681

          The Jenkins docker-image plugin should be updated to either:
          1) fail/warn in this case
          2) provide a way to configure the mount
          3) mount non-C paths to C inside the container. Any variables that reference the non-C drive may need to be updated to use the C drive




          Mark R made changes -
          Component/s New: docker-workflow-plugin [ 20625 ]
          Mark R made changes -
          Description Original: If the workspace is on a different drive (in this case N) then docker.image fails with something like this:

          {noformat}
          00:00:07.112 $ docker run -d -t -w N:/myworkspace/myjob -v N:/myworkspace/myjob/:N:/myworkspace/myjob/ -v N:/myworkspace/myjob@tmp/:N:/myworkspace/myjob@tmp/ -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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** myregistry.com/myrepository/myimage:latest cmd.exe
          . . .
          00:00:08.850 java.io.IOException: Failed to run image 'myregistry.com/myrepository/myimage:latest'. Error: docker: Error response from daemon: hcs::CreateComputeSystem aa1593a84f9df2613191e56fa1b8037bd6d27a4b2c932a1b33e8b6e7f74961d0: The parameter is incorrect.
          {noformat}

          This is due to a limitation in docker on Windows:

          {noformat}
          Volumes on Windows-based containers: When using Windows-based containers, the destination of a volume inside the container must be one of:

          a non-existing or empty directory
          a drive other than C:
          {noformat}

          [documentation|https://docs.docker.com/reference/dockerfile/#notes-about-specifying-volumes] and [documentation|https://docs.docker.com/reference/cli/docker/container/run/#mount-volume--v---read-only]

          See https://github.com/moby/moby/issues/41681

          The Jenkins docker-image plugin should be updated to either:
          1) fail/warn in this case
          2) provide a way to configure the mount
          3) mount non-C paths to C inside the container. Any variables that reference the non-C drive may need to be updated to use the C drive




          New: If the workspace is on a different drive (in this case N) then docker.image fails with something like this:


          {code:java}
          docker.image('myregistry.com/myrepository/myimage:latest').inside {
              sh 'echo test'
          }
          {code}


          {noformat}
          00:00:07.112 $ docker run -d -t -w N:/myworkspace/myjob -v N:/myworkspace/myjob/:N:/myworkspace/myjob/ -v N:/myworkspace/myjob@tmp/:N:/myworkspace/myjob@tmp/ -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 ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** myregistry.com/myrepository/myimage:latest cmd.exe
          . . .
          00:00:08.850 java.io.IOException: Failed to run image 'myregistry.com/myrepository/myimage:latest'. Error: docker: Error response from daemon: hcs::CreateComputeSystem aa1593a84f9df2613191e56fa1b8037bd6d27a4b2c932a1b33e8b6e7f74961d0: The parameter is incorrect.
          {noformat}

          This is due to a limitation in docker on Windows:

          {noformat}
          Volumes on Windows-based containers: When using Windows-based containers, the destination of a volume inside the container must be one of:

          a non-existing or empty directory
          a drive other than C:
          {noformat}

          [documentation|https://docs.docker.com/reference/dockerfile/#notes-about-specifying-volumes] and [documentation|https://docs.docker.com/reference/cli/docker/container/run/#mount-volume--v---read-only]

          See https://github.com/moby/moby/issues/41681

          The Jenkins docker-image plugin should be updated to either:
          1) fail/warn in this case
          2) provide a way to configure the mount
          3) mount non-C paths to C inside the container. Any variables that reference the non-C drive may need to be updated to use the C drive




          Mark R made changes -
          Attachment New: WithContainerStepTest.java [ 63760 ]
          Mark R made changes -
          Attachment Original: WithContainerStepTest.java [ 63760 ]
          Mark R made changes -
          Link New: This issue relates to JENKINS-75087 [ JENKINS-75087 ]
          Mark R made changes -
          Remote Link New: This issue links to "Stack Overflow #63055516 (Web Link)" [ 30485 ]
          Mark R made changes -
          Link New: This issue relates to JENKINS-75102 [ JENKINS-75102 ]
          Mark R made changes -
          Remote Link New: This issue links to "Github #41681 (Web Link)" [ 30498 ]

            ndeloof Nicolas De Loof
            mrichar2 Mark R
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: