1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

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 70fdafa41d
commit ddb45c943b
4 changed files with 9 additions and 1 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{