summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/images_build.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/compat/images_build.go')
-rw-r--r--pkg/api/handlers/compat/images_build.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index a00f0b089..020991cc7 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -694,7 +694,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
success bool
)
- runCtx, cancel := context.WithCancel(context.Background())
+ runCtx, cancel := context.WithCancel(r.Context())
go func() {
defer cancel()
imageID, _, err = runtime.Build(r.Context(), buildOptions, containerFiles...)