jenkinsci / jenkinsci/docker-workflow-plugin
[JENKINS-51443] Wrong mount point spec for Windows Containers in Docker
- Dominant language
- Java
- Stars
- 527
- Forks
- 422
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
It seems that ":z" volume bind mount flag in docker is not suported for windows containers.
For jenkinsfile:
pipeline {
agent {
docker { image 'mksondej/aspnet-node-msbuild' }
}
stages {
stage('Test') {
steps {
powershell 'ls'
}
}
}
}
Here's what my pipeline tries to execute:
docker run -t -d -u 18:18 -w "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA" -v "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z" -v "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA@tmp:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA@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 ******** mksondej/aspnet-node-msbuild cat
and the result is:
java.io.IOException: Failed to run image 'mksondej/aspnet-node-msbuild'. Error: docker: Error response from daemon: invalid bind mount spec "C:\\Program Files (x86)\\Jenkins\\workspace\\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\\Program Files (x86)\\Jenkins\\workspace\\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z": invalid volume specification: 'C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z'
It seems that running windows containers in the pipeline is currently impossible?
By manually fiddling with the command above I've found out that without ":z" ("rw" can stay) it would work properly. I've tried to make a crude workaround by making a bat cmd somewhere in my PATH which would make a simple string replacement, but it only worked from my or other user's command line. The pipeline seems to run docker.exe directly.
Any wokaround would be more than welcome, thanks ![]()
---
Originally reported by mksondej, imported from: Wrong mount point spec for Windows Containers in Docker
Raw content of original issue
It seems that ":z" volume bind mount flag in docker is not suported for windows containers.
For jenkinsfile:
pipeline {
agent {
docker { image 'mksondej/aspnet-node-msbuild' }
}
stages {
stage('Test') {
steps {
powershell 'ls'
}
}
}
}Here's what my pipeline tries to execute:
docker run -t -d -u 18:18 -w "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA" -v "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z" -v "C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA@tmp:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA@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 ******** mksondej/aspnet-node-msbuild cat
and the result is:
java.io.IOException: Failed to run image 'mksondej/aspnet-node-msbuild'. Error: docker: Error response from daemon: invalid bind mount spec "C:\\Program Files (x86)\\Jenkins\\workspace\\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\\Program Files (x86)\\Jenkins\\workspace\\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z": invalid volume specification: 'C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:C:\Program Files (x86)\Jenkins\workspace\test1_master-X2GYJHOEIWFTSVMPO3GB3GYF3NB4R7IFICRXKGCY7NVNWOUOC5QA:rw,z'It seems that running windows containers in the pipeline is currently impossible?
By manually fiddling with the command above I've found out that without ":z" ("rw" can stay) it would work properly. I've tried to make a crude workaround by making a bat cmd somewhere in my PATH which would make a simple string replacement, but it only worked from my or other user's command line. The pipeline seems to run docker.exe directly.
Any wokaround would be more than welcome, thanks
environment
```
Jenkins ver. 2.107.3
installed from the official installer, not running in any VM nor docker.
Single node setup with default config.
os.arch x86
os.name Windows Server 2016
os.version 10.0
Plugins:
docker-commons 1.13 true
docker-workflow 1.17 true
```
Contributor guide
Assessment
This issue has not been assessed yet.