Fixes #9085: Cannot `up` a machine with Docker Toolbox and Git Bash
This commit is contained in:
parent
04fdab961e
commit
03178bbe04
|
@ -49,14 +49,23 @@ module VagrantPlugins
|
||||||
run_cmd += volumes.map { |v|
|
run_cmd += volumes.map { |v|
|
||||||
v = v.to_s
|
v = v.to_s
|
||||||
if v.include?(":") && @executor.windows?
|
if v.include?(":") && @executor.windows?
|
||||||
host, guest = v.split(":", 2)
|
if v.index(":") != v.rindex(":")
|
||||||
host = Vagrant::Util::Platform.windows_path(host)
|
# If we have 2 colons, the host path is an absolute Windows URL
|
||||||
# NOTE: Docker does not support UNC style paths (which also
|
# and we need to remove the colon from it
|
||||||
# means that there's no long path support). Hopefully this
|
host, colon, guest = v.rpartition(":")
|
||||||
# will be fixed someday and the gsub below can be removed.
|
host = "//" + host[0].downcase + host[2..-1]
|
||||||
host.gsub!(/^[^A-Za-z]+/, "")
|
v = [host, guest].join(":")
|
||||||
v = [host, guest].join(":")
|
else
|
||||||
|
host, guest = v.split(":", 2)
|
||||||
|
host = Vagrant::Util::Platform.windows_path(host)
|
||||||
|
# NOTE: Docker does not support UNC style paths (which also
|
||||||
|
# means that there's no long path support). Hopefully this
|
||||||
|
# will be fixed someday and the gsub below can be removed.
|
||||||
|
host.gsub!(/^[^A-Za-z]+/, "")
|
||||||
|
v = [host, guest].join(":")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
['-v', v.to_s]
|
['-v', v.to_s]
|
||||||
}
|
}
|
||||||
run_cmd += %W(--privileged) if params[:privileged]
|
run_cmd += %W(--privileged) if params[:privileged]
|
||||||
|
|
Loading…
Reference in New Issue