mirror of
https://github.com/docker/compose.git
synced 2025-07-24 06:04:57 +02:00
Merge pull request #2026 from ulyssessouza/warn-pull-build
This commit is contained in:
commit
6a6dafbdb5
@ -58,6 +58,7 @@ func (s *composeService) pull(ctx context.Context, project *types.Project, opts
|
|||||||
w := progress.ContextWriter(ctx)
|
w := progress.ContextWriter(ctx)
|
||||||
eg, ctx := errgroup.WithContext(ctx)
|
eg, ctx := errgroup.WithContext(ctx)
|
||||||
|
|
||||||
|
var mustBuild []string
|
||||||
for _, service := range project.Services {
|
for _, service := range project.Services {
|
||||||
service := service
|
service := service
|
||||||
if service.Image == "" {
|
if service.Image == "" {
|
||||||
@ -72,6 +73,9 @@ func (s *composeService) pull(ctx context.Context, project *types.Project, opts
|
|||||||
err := s.pullServiceImage(ctx, service, info, s.configFile, w, false)
|
err := s.pullServiceImage(ctx, service, info, s.configFile, w, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !opts.IgnoreFailures {
|
if !opts.IgnoreFailures {
|
||||||
|
if service.Build != nil {
|
||||||
|
mustBuild = append(mustBuild, service.Name)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
w.TailMsgf("Pulling %s: %s", service.Name, err.Error())
|
w.TailMsgf("Pulling %s: %s", service.Name, err.Error())
|
||||||
@ -80,7 +84,13 @@ func (s *composeService) pull(ctx context.Context, project *types.Project, opts
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return eg.Wait()
|
err = eg.Wait()
|
||||||
|
|
||||||
|
if !opts.IgnoreFailures && len(mustBuild) > 0 {
|
||||||
|
w.TailMsgf("WARNING: Some service image(s) must be built from source by running:\n docker compose build %s", strings.Join(mustBuild, " "))
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *composeService) pullServiceImage(ctx context.Context, service types.ServiceConfig, info moby.Info, configFile driver.Auth, w progress.Writer, quietPull bool) error {
|
func (s *composeService) pullServiceImage(ctx context.Context, service types.ServiceConfig, info moby.Info, configFile driver.Auth, w progress.Writer, quietPull bool) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user