Skip to content

Commit

Permalink
Addressed Robert's feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhittaker committed Nov 6, 2023
1 parent b46fa53 commit 4027b71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/impl/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (
"github.com/ServiceWeaver/weaver/runtime/protos"
)

// The maximum time to wait for `docker build` to finish before aborting.
const dockerBuildTimeout = time.Second * 120

// dockerOptions configure how Docker images are built and pushed.
type dockerOptions struct {
image string // see kubeConfig.Image
Expand Down Expand Up @@ -123,7 +126,7 @@ downloaded and installed in the container. Do you want to proceed? [Y/n] `)
install = "github.com/ServiceWeaver/weaver-kube/cmd/weaver-kube@" + toolVersion
}

// Create a Dockerfile.
// Create a Dockerfile in workDir/.
type content struct {
Install string // "weaver-kube" binary to install, if any
Entrypoint string // container entrypoint
Expand Down Expand Up @@ -157,7 +160,7 @@ ENTRYPOINT ["{{.Entrypoint}}"]
return "", err
}

ctx, cancel := context.WithTimeout(ctx, time.Second*120)
ctx, cancel := context.WithTimeout(ctx, dockerBuildTimeout)
defer cancel()
return image, dockerBuild(ctx, workDir, image)
}
Expand Down

0 comments on commit 4027b71

Please sign in to comment.