@@ -13,7 +13,6 @@ import (
1313 "github.com/docker/buildx/util/imagetools"
1414 "github.com/docker/buildx/util/progress"
1515 "github.com/docker/cli/cli/command"
16- "github.com/moby/buildkit/util/appcontext"
1716 "github.com/moby/buildkit/util/progress/progressui"
1817 "github.com/opencontainers/go-digest"
1918 ocispec "github.com/opencontainers/image-spec/specs-go/v1"
@@ -32,7 +31,7 @@ type createOptions struct {
3231 progress string
3332}
3433
35- func runCreate (dockerCli command.Cli , in createOptions , args []string ) error {
34+ func runCreate (ctx context. Context , dockerCli command.Cli , in createOptions , args []string ) error {
3635 if len (args ) == 0 && len (in .files ) == 0 {
3736 return errors .Errorf ("no sources specified" )
3837 }
@@ -113,8 +112,6 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error {
113112 }
114113 }
115114
116- ctx := appcontext .Context ()
117-
118115 b , err := builder .New (dockerCli , builder .WithName (in .builder ))
119116 if err != nil {
120117 return err
@@ -274,7 +271,7 @@ func createCmd(dockerCli command.Cli, opts RootOptions) *cobra.Command {
274271 Short : "Create a new image based on source images" ,
275272 RunE : func (cmd * cobra.Command , args []string ) error {
276273 options .builder = * opts .Builder
277- return runCreate (dockerCli , options , args )
274+ return runCreate (cmd . Context (), dockerCli , options , args )
278275 },
279276 ValidArgsFunction : completion .Disable ,
280277 }
0 commit comments