feat: add option for custom socket path (#698)

This commit is contained in:
Ryan (hackercat)
2021-05-23 14:43:09 +00:00
committed by GitHub
parent 764263ce0e
commit 799098b0e6
5 changed files with 39 additions and 29 deletions

View File

@@ -67,8 +67,12 @@ func (rc *RunContext) jobContainerName() string {
func (rc *RunContext) GetBindsAndMounts() ([]string, map[string]string) {
name := rc.jobContainerName()
if rc.Config.ContainerDaemonSocket == "" {
rc.Config.ContainerDaemonSocket = "/var/run/docker.sock"
}
binds := []string{
fmt.Sprintf("%s:%s", "/var/run/docker.sock", "/var/run/docker.sock"),
fmt.Sprintf("%s:%s", rc.Config.ContainerDaemonSocket, "/var/run/docker.sock"),
}
mounts := map[string]string{

View File

@@ -37,6 +37,7 @@ type Config struct {
Privileged bool // use privileged mode
UsernsMode string // user namespace to use
ContainerArchitecture string // Desired OS/architecture platform for running containers
ContainerDaemonSocket string // Path to Docker daemon socket
UseGitIgnore bool // controls if paths in .gitignore should not be copied into container, default true
GitHubInstance string // GitHub instance to use, default "github.com"
}