Skip to content

Commit

Permalink
Docker build resiliance with a retry (elastic#21587)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Oct 8, 2020
1 parent d6d7c85 commit f5b1c37
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dev-tools/mage/integtest_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"runtime"
"strings"
"sync"
"time"

"github.com/pkg/errors"

Expand Down Expand Up @@ -246,5 +247,17 @@ func dockerComposeBuildImages() error {
os.Stderr,
"docker-compose", args...,
)

// This sleep is to avoid hitting the docker build issues when resources are not available.
if err != nil {
fmt.Println(">> Building docker images again")
time.Sleep(10)
_, err = sh.Exec(
composeEnv,
out,
os.Stderr,
"docker-compose", args...,
)
}
return err
}

0 comments on commit f5b1c37

Please sign in to comment.