Skip to content

Commit

Permalink
Merge 7591330 into 3e8cdea
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne committed Feb 20, 2019
2 parents 3e8cdea + 7591330 commit a7aa601
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions docker_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
package main

import (
"github.com/coveo/gotemplate/utils"
"fmt"
"os"
"strings"
"syscall"
)

const dockerSocketMountPattern = "%[1]s:%[1]s"

func getDockerGroup() string {
cmd, tempFile, err := utils.GetCommandFromString("stat -c '%g' " + dockerSocketFile)
if err != nil {
panic(err)
}
if tempFile != "" {
defer func() { os.Remove(tempFile) }()
}
return strings.TrimSpace(string(must(cmd.Output()).([]byte)))
s, _ := os.Stat(dockerSocketFile)
return fmt.Sprintf("%v", s.Sys().(*syscall.Stat_t).Gid)
}

0 comments on commit a7aa601

Please sign in to comment.