Skip to content

Commit

Permalink
build: only print COMPOSE_BAKE recommendation when disabled
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
emersion authored and ndeloof committed Feb 22, 2025
1 parent cae8e84 commit 3292740
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/compose/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 3292740

Please sign in to comment.