From 4bba960863136be903320206adb4b9988606acdc Mon Sep 17 00:00:00 2001 From: Jocelyn Giroux Date: Thu, 25 May 2017 15:49:36 -0400 Subject: [PATCH] Just use the presence of the environment variable DOCKER_MACHINE_NAME on Windows to determine if the path should be changed Updated to terragrunt v0.12.18.02 (Coveo edition) --- Dockerfile | 2 +- Dockerfile.Full | 2 +- Dockerfile.Shell | 2 +- docker.go | 14 +++----------- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index fae2af6..b14ed97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest ARG TERRAFORM_VERSION=0.9.5 -ARG TERRAGRUNT_VERSION=0.12.18.01 +ARG TERRAGRUNT_VERSION=0.12.18.02 ARG GOTEMPLATE_VERSION=1.0 LABEL vendor="Coveo" diff --git a/Dockerfile.Full b/Dockerfile.Full index f9a647d..09cfa24 100644 --- a/Dockerfile.Full +++ b/Dockerfile.Full @@ -1,7 +1,7 @@ FROM ubuntu:latest ARG TERRAFORM_VERSION=0.9.5 -ARG TERRAGRUNT_VERSION=0.12.18.01 +ARG TERRAGRUNT_VERSION=0.12.18.02 ARG GOTEMPLATE_VERSION=1.0 ARG DEBIAN_FRONTEND=noninteractive diff --git a/Dockerfile.Shell b/Dockerfile.Shell index da52757..ef41049 100644 --- a/Dockerfile.Shell +++ b/Dockerfile.Shell @@ -1,7 +1,7 @@ FROM alpine:latest ARG TERRAFORM_VERSION=0.9.5 -ARG TERRAGRUNT_VERSION=0.12.18.01 +ARG TERRAGRUNT_VERSION=0.12.18.02 ARG GOTEMPLATE_VERSION=1.0 LABEL vendor="Coveo" diff --git a/docker.go b/docker.go index b5ef2c0..55525df 100644 --- a/docker.go +++ b/docker.go @@ -103,18 +103,10 @@ func getEnviron() (result []string) { // This function set the path converter function // For old Windows version still using docker-machine and VirtualBox, -// it transforms the C:\ to \C\. +// it transforms the C:\ to /C/. func getPathConversionFunction() func(string) string { - noConversion := func(path string) string { return path } - if runtime.GOOS != "windows" { - return noConversion - } - - var out bytes.Buffer - dockerCmd := exec.Command("docker-machine", "env") - dockerCmd.Stdout, dockerCmd.Stderr = &out, &out - if dockerCmd.Run() != nil { - return noConversion + if runtime.GOOS != "windows" || os.Getenv("DOCKER_MACHINE_NAME") == "" { + return func(path string) string { return path } } return func(path string) string {