-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to mount the docker socket
- Loading branch information
Julien Duchesne
committed
Oct 5, 2018
1 parent
ce3288a
commit 13023c6
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/coveo/gotemplate/utils" | ||
"os" | ||
"strings" | ||
) | ||
|
||
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))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
const dockerSocketMountPattern = "/%[1]s:%[1]s" | ||
|
||
func getDockerGroup() string { | ||
return "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters