jenkinsci / jenkinsci/docker-workflow-plugin

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

Open
#724 1 comment 0 reactions 0 assignees View on GitHub
component:docker-plugin component:docker-workflow-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

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

---
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 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.