build: only print COMPOSE_BAKE recommendation when disabled

docker-compose now prints a recommendation to set COMPOSE_BAKE=true
when service deps are used. However, when the user opts-in to bake,
the recommendation is still printed.

Only print the recommendation when bake is disabled.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2025-02-22 01:25:27 +01:00 committed by Nicolas De loof
parent cae8e84636
commit 3292740c19

View File

@ -100,10 +100,6 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
return imageIDs, err
}
if serviceDeps {
logrus.Infof(`additional_context with "service:"" is better supported when delegating build go bake. Set COMPOSE_BAKE=true`)
}
err = project.ForEachService(options.Services, func(serviceName string, service *types.ServiceConfig) error {
if service.Build == nil {
return nil
@ -128,6 +124,10 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
return s.doBuildBake(ctx, project, serviceToBuild, options)
}
if serviceDeps {
logrus.Infof(`additional_context with "service:"" is better supported when delegating build go bake. Set COMPOSE_BAKE=true`)
}
// Initialize buildkit nodes
buildkitEnabled, err := s.dockerCli.BuildKitEnabled()
if err != nil {