From a281e60e15f34bc9748ee2ef7f68af03bb1fa684 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 22 Jun 2017 10:16:36 -0700 Subject: [PATCH] de-mangle windows filepath to something docker can handle --- builder/docker/driver_docker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builder/docker/driver_docker.go b/builder/docker/driver_docker.go index ac691a3a4..61c5ad93e 100644 --- a/builder/docker/driver_docker.go +++ b/builder/docker/driver_docker.go @@ -8,6 +8,7 @@ import ( "os" "os/exec" "regexp" + "runtime" "strings" "sync" @@ -227,6 +228,11 @@ func (d *DockerDriver) StartContainer(config *ContainerConfig) (string, error) { args = append(args, "--privileged") } for host, guest := range config.Volumes { + if runtime.GOOS == "windows" { + // docker-toolbox can't handle the normal C:\filepath format in CLI + host = strings.Replace(host, "\\", "/", -1) + host = strings.Replace(host, "C:/", "/c/", 1) + } args = append(args, "-v", fmt.Sprintf("%s:%s", host, guest)) } for _, v := range config.RunCommand {