Skip to content

Commit

Permalink
Docker build resiliance with a retry (elastic#21587) (elastic#21680)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Oct 8, 2020
1 parent bf5a5df commit 374ee52
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 @@ -26,6 +26,7 @@ import (
"runtime"
"strings"
"sync"
"time"

"github.com/pkg/errors"

Expand Down Expand Up @@ -240,5 +241,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 374ee52

Please sign in to comment.