mirror of
https://github.com/docker/compose.git
synced 2025-07-09 14:54:27 +02:00
Merge pull request #1010 from docker/fix-ctrl-c-on-build
Give progress its own context
This commit is contained in:
commit
ab8c97d31e
@ -103,8 +103,15 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opts
|
|||||||
Driver: d,
|
Driver: d,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Progress needs its own context that lives longer than the
|
||||||
|
// build one otherwise it won't read all the messages from
|
||||||
|
// build and will lock
|
||||||
|
progressCtx, cancel := context.WithCancel(context.Background())
|
||||||
|
defer cancel()
|
||||||
|
w := progress.NewPrinter(progressCtx, os.Stdout, "auto")
|
||||||
|
|
||||||
// We rely on buildx "docker" builder integrated in docker engine, so don't need a DockerAPI here
|
// We rely on buildx "docker" builder integrated in docker engine, so don't need a DockerAPI here
|
||||||
w := progress.NewPrinter(ctx, os.Stdout, "auto")
|
|
||||||
_, err = build.Build(ctx, driverInfo, opts, nil, nil, w)
|
_, err = build.Build(ctx, driverInfo, opts, nil, nil, w)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user