Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
fix docker bug
Browse files Browse the repository at this point in the history
  • Loading branch information
everettraven committed Feb 27, 2022
1 parent 39fe941 commit 6e659ae
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions utils/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,8 @@ func (u *Utility) RunContainer(image string, ports []string, volumes []string, c
var target string
var options string

// If the host is a windows machine we need to remove the 'C:' and add it again later
if runtime.GOOS == "windows" {
vol = strings.TrimLeft(vol, "c:")
source += "C:"
if strings.Contains(vol, "C:") {
vol = strings.TrimLeft(vol, "C:")
}

if vErr := u.validateRunContainerVolume(vol); vErr != nil {
Expand All @@ -157,12 +155,12 @@ func (u *Utility) RunContainer(image string, ports []string, volumes []string, c
splitVol := strings.Split(vol, ":")

if len(splitVol) == 3 {
source += splitVol[0]
target += splitVol[1]
options += ":" + splitVol[2]
source = splitVol[0]
target = splitVol[1]
options = ":" + splitVol[2]
} else {
source += splitVol[0]
target += splitVol[1]
source = splitVol[0]
target = splitVol[1]
}

source, err := filepath.Abs(source)
Expand Down

0 comments on commit 6e659ae

Please sign in to comment.