Skip to content

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

@jenkins-infra-bot

Description

@jenkins-infra-bot

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 moby/moby#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


Originally reported by mrichar2, imported from: Jenkins docker-image plugin does not work with non-C windows drives
  • assignee: ndeloof
  • status: Open
  • priority: Minor
  • component(s): docker-plugin, docker-workflow-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07
Raw content of original issue

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 moby/moby#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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions