Merge pull request #5048 from hashicorp/4887_patch
Fix windows filepath in docker-toolbox call.
This commit is contained in:
commit
0b0fd408c4
|
@ -8,6 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
@ -227,6 +228,11 @@ func (d *DockerDriver) StartContainer(config *ContainerConfig) (string, error) {
|
||||||
args = append(args, "--privileged")
|
args = append(args, "--privileged")
|
||||||
}
|
}
|
||||||
for host, guest := range config.Volumes {
|
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))
|
args = append(args, "-v", fmt.Sprintf("%s:%s", host, guest))
|
||||||
}
|
}
|
||||||
for _, v := range config.RunCommand {
|
for _, v := range config.RunCommand {
|
||||||
|
|
Loading…
Reference in New Issue