You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-07-12 22:21:40 +02:00
Respect cli argument when checking docker backend availability (#3770)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
This commit is contained in:
@ -62,9 +62,11 @@ func (e *docker) Name() string {
|
|||||||
return "docker"
|
return "docker"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *docker) IsAvailable(context.Context) bool {
|
func (e *docker) IsAvailable(ctx context.Context) bool {
|
||||||
if os.Getenv("DOCKER_HOST") != "" {
|
if c, ok := ctx.Value(backend.CliContext).(*cli.Context); ok {
|
||||||
return true
|
if c.IsSet("backend-docker-host") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_, err := os.Stat("/var/run/docker.sock")
|
_, err := os.Stat("/var/run/docker.sock")
|
||||||
return err == nil
|
return err == nil
|
||||||
|
Reference in New Issue
Block a user