Vagrant Docker Provider - Windows Volumes

93 views
Skip to first unread message

Jamie Jackson

unread,
Feb 21, 2018, 7:31:36 PM2/21/18
to vagra...@googlegroups.com
Vagrant seems to be trying to manipulate my local path, for some reason:

Vagrantfile snippet:

  config.vm.define "centos-jenkins" do |c|
    c.vm.provider "docker" do |d|
      d.name = "centos-jenkins2"
      d.image = "jenkins/jenkins:2.91-alpine"
      d.ports  = ["9898:8080"]
      d.volumes = ['/c/Users/15037/workspace/centos-vagrant-fresh:/var/jenkins_home']
    end
  end

Output:


Command: ["docker", "run", "--name", "centos-jenkins2", "-d", "-p", "9898:8080", "-v", "c\\Users\\15037\\workspace\\centos-vagrant-fresh:/var/jenkins_home", "jenkins/jenkins:2.91-alpine", {:notify=>[:stdou
t, :stderr]}]

Stderr: C:\Program Files\Docker Toolbox/docker.EXE: Error response from daemon: create c\Users\15037\workspace\centos-vagrant-fresh: "c\\Users\\15037\\workspace\\centos-vagrant-fresh" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
See 'C:\Program Files\Docker Toolbox/docker.EXE run --help'.

How can I get it to leave my path alone? (It works fine from a straight `docker run`.)


Jamie Jackson

unread,
Feb 22, 2018, 4:39:06 PM2/22/18
to vagra...@googlegroups.com
For now, I'm hacking Vagrant:


--- /cygdrive/c/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/docker/driver.orig.rb 2018-02-22 13:11:00.934731600 -0500

+++ /cygdrive/c/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/docker/driver.rb 2018-02-22 13:01:42.703345200 -0500

@@ -48,7 +48,7 @@

         run_cmd += ports.map { |p| ['-p', p.to_s] }

         run_cmd += volumes.map { |v|

           v = v.to_s

-          if false v.include?(":") && @executor.windows?

+          if false && v.include?(":") && @executor.windows?

             host, guest = v.split(":", 2)

             host = Vagrant::Util::Platform.windows_path(host)

             # NOTE: Docker does not support UNC style paths (which also


Jamie Jackson

unread,
Feb 22, 2018, 6:36:15 PM2/22/18
to Vagrant
That diff was messed up, it should have been:

-          if v.include?(":") && @executor.windows?

+          if false && v.include?(":") && @executor.windows?


Alvaro Miranda Aguilera

unread,
Feb 24, 2018, 5:59:57 AM2/24/18
to vagra...@googlegroups.com
developers saw your message and they are thinking

feel free to open an issue on github


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1581532e-fb3d-4ce7-9d85-138330955503%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Jamie Jackson

unread,
Oct 8, 2018, 4:40:59 PM10/8/18
to Vagrant
I guess I forgot about this thread. I've just added an issue: https://github.com/hashicorp/vagrant/issues/10274
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages