[JIRA] (JENKINS-48518) Docker Pipeline: invalid volume specification with Windows slave and Linux master

109 views
Skip to first unread message

bjoernbur@hotmail.com (JIRA)

unread,
Mar 7, 2018, 11:19:02 AM3/7/18
to jenkinsc...@googlegroups.com
Björn Bur commented on Bug JENKINS-48518
 
Re: Docker Pipeline: invalid volume specification with Windows slave and Linux master

I have the same problem. Are there any news?

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

gerardnico@gmail.com (JIRA)

unread,
Mar 17, 2018, 9:02:03 AM3/17/18
to jenkinsc...@googlegroups.com

Hallo,

I was wondering why it was not working and I have found the following.

C:\ path doesn't work with a Linux Docker Host because a docker run -v option is waiting a path on the host as the first field. See

definition in the doc

 

Because my host is a linux system (boot2docker), it expects a Linux path.

This is working for me when I configured my virtual box shared drive to mount `c:\` on the host.
 

docker run -it --rm -v /c/users:/pathInContainer/  ubuntu bash

 

Is there a way to get the Windows path processed through an utility such as cygpath (or something similar) before execution ?

Thanks 

 

raphael@hoeser.info (JIRA)

unread,
Aug 17, 2018, 4:11:01 AM8/17/18
to jenkinsc...@googlegroups.com
... -v C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:C:\Jenkins\workspace\dummy-windows_dockerfile-2QPBAXYBKIKABK3TWL47EDMYETQTPG4UEJF46JIKPPRRDECSXV4Q:rw,z

According to my research the problem isn't the C: filepath, as windows has no Problems working with it, but the "z" flag at the end!

 

When I remove that flag and run the docker command like it's given in the Jenkins Log everything works fine, but when you add the z flag (even when it's the only one) it makes the path description invalid for Docker on windows. I currently don't have a linux machine not running SELinux on hand to test it on other Linux derivates, but I think this flag shouldn't always be added to the volume specification.

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

pavel_calin@yahoo.com (JIRA)

unread,
Jan 5, 2019, 9:48:02 AM1/5/19
to jenkinsc...@googlegroups.com

Indeed, the problem is generated by extra flag "z" added for volumes. 

This is added in DockerClient class:

for (Map.Entry<String, String> volume : volumes.entrySet())

{ argb.add("-v", volume.getKey() + ":" + volume.getValue() + ":rw,z"); }
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

lsilverman@trackabout.com (JIRA)

unread,
May 16, 2019, 5:58:03 PM5/16/19
to jenkinsc...@googlegroups.com

raphael@hoeser.info (JIRA)

unread,
May 17, 2019, 7:19:05 AM5/17/19
to jenkinsc...@googlegroups.com

Larry Silverman Sadly not really - the github issue had some ideas with writing libraries, which call the docker commands directly, but that doesn't provide the same feature set. Maybe it is possible to use a kubernetes cluster to use docker on windows. (We switched to jenkins in kubernetes, but we also now use wine in the most part with linux hosts)

anonymousaccounts@icloud.com (JIRA)

unread,
Oct 2, 2019, 6:24:03 PM10/2/19
to jenkinsc...@googlegroups.com
a b commented on Bug JENKINS-48518

We are also running into the same issue and can confirm that removing the ",z" portion resolves the "invalid volume specification" error

Running Windows Server 2016 with Docker 19.03.2, build c92ab06ed9 (CLI only not the Docker Desktop app).

How can we go about resolving this issue for nodes with a Windows host OS? I love and much prefer Linux but sadly we have developer requirements on the Windows side and have to support it in our pipelines.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

anonymousaccounts@icloud.com (JIRA)

unread,
Oct 3, 2019, 6:35:02 PM10/3/19
to jenkinsc...@googlegroups.com
a b edited a comment on Bug JENKINS-48518
We are also running into the same issue and can confirm that removing the ",z" portion resolves the "invalid volume specification" error

Running Windows Server 2016 with Docker 19.03.2, build c92ab06ed9 (CLI only not the Docker Desktop app).

How can we go about resolving this issue for nodes with a Windows host OS? I love and much prefer Linux but sadly we have developer requirements on the Windows side and have to support it in our pipelines.


*EDIT*: I'm going to assume this concept is dead in the water based on this thread.. I have browsed through the source and it's riddled with Linux specific commands for interacting with docker and there seems to be zero appetite for making it Windows compatible.
https://issues.jenkins-ci.org/browse/JENKINS-36776

We are going to attempt to use the alternate docker-plugin which interacts directly with the Docker Engine API on the host and thus should be more host OS agnostic, though there might be more quirks there too. TBD. The immediate downside is there doesn't seem to be support for Dockerfile files and the images have be be pre-build and pre-defined in the plugin UI under Configure > Cloud > Docker which is odd and kind of ridiculous since this moves away from CI/CD philosophies I'd argue and move programmable features into a UI. Sad.

anonymousaccounts@icloud.com (JIRA)

unread,
Oct 4, 2019, 1:52:03 PM10/4/19
to jenkinsc...@googlegroups.com


 

*EDIT 2*: Some kind soul has submitted a PR that resolves this. I build, installed, and tested it this morning with a simple hello world style declarative pipeline on Linux and Windows and it works. Fingers crossed this will make it to prime time soon.
[https://github.com/jenkinsci/docker-workflow-plugin/pull/183]

anonymousaccounts@icloud.com (JIRA)

unread,
Oct 4, 2019, 1:53:03 PM10/4/19
to jenkinsc...@googlegroups.com
a b edited a comment on Bug JENKINS-48518
We are also running into the same issue and can confirm that removing the ",z" portion resolves the "invalid volume specification" error

Running Windows Server 2016 with Docker 19.03.2, build c92ab06ed9 (CLI only not the Docker Desktop app).

How can we go about resolving this issue for nodes with a Windows host OS? I love and much prefer Linux but sadly we have developer requirements on the Windows side and have to support it in our pipelines.

*EDIT*: I'm going to assume this concept is dead in the water based on this thread.. I have browsed through the source and it's riddled with Linux specific commands for interacting with docker and there seems to be zero appetite for making it Windows compatible.
https://issues.jenkins-ci.org/browse/JENKINS-36776

We are going to attempt to use the alternate docker-plugin which interacts directly with the Docker Engine API on the host and thus should be more host OS agnostic, though there might be more quirks there too. TBD. The immediate downside is there doesn't seem to be support for Dockerfile files and the images have be be pre-build and pre-defined in the plugin UI under Configure > Cloud > Docker which is odd and kind of ridiculous since this moves away from CI/CD philosophies I'd argue and move programmable features into a UI. Sad.

 

*EDIT 2*: * Some kind soul has submitted a PR that resolves this. * I build, installed, and tested it this morning with a simple hello world style declarative pipeline on Linux and Windows and it works. Fingers crossed this will make it to prime time soon.
[https://github.com/jenkinsci/docker-workflow-plugin/pull/183]
Reply all
Reply to author
Forward
0 new messages