diff --git a/pkg/runner/builtin/runner.go b/pkg/runner/builtin/runner.go index 3ed76b2a7..f233ae1ff 100644 --- a/pkg/runner/builtin/runner.go +++ b/pkg/runner/builtin/runner.go @@ -257,7 +257,17 @@ func (r *Runner) Logs(job *types.Job) (io.ReadCloser, error) { // make sure this container actually exists info, err := client.InspectContainer(cname(job)) if err != nil { - return nil, err + // add a small exponential backoff since there + // is a small window when the container hasn't + // been created yet, but the build is about to start + for i := 0; ; i++ { + time.Sleep(1 * time.Second) + info, err = client.InspectContainer(cname(job)) + if err != nil && i == 5 { + return nil, err + } + break + } } // verify the container is running. if not we'll