mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-24 10:07:21 +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:
parent
1953a0ec5a
commit
044c3a6dd5
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user