jenkinsci / jenkinsci/docker-workflow-plugin
[JENKINS-74912] Jenkins docker-image plugin does not work with non-C windows drives
- 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
ndeloof
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
Assessment
This issue has not been assessed yet.