From bf6d7bf47e0f1745e3e7f233c0e59b080b475a2e Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Tue, 5 Aug 2025 12:14:00 +0200 Subject: [PATCH] define pull and no_cache from either service or flags values when building with bake Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- pkg/compose/build_bake.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/compose/build_bake.go b/pkg/compose/build_bake.go index 165e5e54d..730169045 100644 --- a/pkg/compose/build_bake.go +++ b/pkg/compose/build_bake.go @@ -226,6 +226,9 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project image := api.GetImageNameOrDefault(service, project.Name) expectedImages[serviceName] = image + pull := service.Build.Pull || options.Pull + noCache := service.Build.NoCache || options.NoCache + target := targets[serviceName] cfg.Targets[target] = bakeTarget{ Context: build.Context, @@ -243,8 +246,8 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project Target: build.Target, Secrets: toBakeSecrets(project, build.Secrets), SSH: toBakeSSH(append(build.SSH, options.SSHs...)), - Pull: options.Pull, - NoCache: options.NoCache, + Pull: pull, + NoCache: noCache, ShmSize: build.ShmSize, Ulimits: toBakeUlimits(build.Ulimits), Entitlements: entitlements,