Docker Community Forums

Share and learn in the Docker community.

Unable to bind mount Windows host volume in Docker plugin

Expected behavior

Here is command I run to bind mount the volume and it works. now I want to dynamically provision build agent using docker plugin.

docker run -d --name agent-00 --restart=always -v X:\:G: -e JENKINS_MASTER_HOST=docker -e JENKINS_AGENT_ID=WIN_00 -e JENKINS_SECRET=xxxxx jenkins-agent:latest

but docker-java code (used by docker plugin) does not support windows path volume, following bind mount is not recognized cause it contains more than one colon.

X:\:G:\

Error Message:

Note: Disabled 29 sec ago due to error. Will re-enable in 4 min 30 sec.
Reason: Template provisioning failed.

java.lang.IllegalArgumentException	at com.github.dockerjava.api.model.Bind.parse(Bind.java:130)Caused: java.lang.IllegalArgumentException: Error parsing Bind 'X:\:G:\'

Is there any workaround for this problem,for example, a windows path without colon that can be recognized by docker on windows? Thanks.

Actual behavior

Information

X: drive is a remote SMB share on Docker host (Windows server 2019)

Docker plugin settings:
https://user-images.githubusercontent.com/13327028/66377998-33f53000-e9e5-11e9-8eeb-dc2cf0fd75cd.JPG

The pull request for Windows volume parsing fix.
docker-java/docker-java#920

Steps to reproduce the behavior