Skip to content

Commit

Permalink
Do not hardcode docker socket
Browse files Browse the repository at this point in the history
Fix #757
  • Loading branch information
mscherer committed Feb 8, 2022
1 parent 8ce4178 commit 076d656
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pipeline/backend/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ func (e *docker) Name() string {
}

func (e *docker) IsAvailable() bool {
_, err := os.Stat("/var/run/docker.sock")
path := "/var/run/docker.sock"
if host := os.Getenv("DOCKER_HOST"); host != "" {
path = host
}
_, err := os.Stat(path)
return err == nil
}

Expand Down

0 comments on commit 076d656

Please sign in to comment.