mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-22 18:01:02 +00: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
1 changed files with 5 additions and 3 deletions
|
@ -62,9 +62,11 @@ func (e *docker) Name() string {
|
|||
return "docker"
|
||||
}
|
||||
|
||||
func (e *docker) IsAvailable(context.Context) bool {
|
||||
if os.Getenv("DOCKER_HOST") != "" {
|
||||
return true
|
||||
func (e *docker) IsAvailable(ctx context.Context) bool {
|
||||
if c, ok := ctx.Value(backend.CliContext).(*cli.Context); ok {
|
||||
if c.IsSet("backend-docker-host") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
_, err := os.Stat("/var/run/docker.sock")
|
||||
return err == nil
|
||||
|
|
Loading…
Reference in a new issue