Browse Source

add default compose labels to images built from bake

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours 4 months ago
parent
commit
5e147e852e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pkg/compose/build_bake.go

+ 2 - 1
pkg/compose/build_bake.go

@@ -164,6 +164,7 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
 			continue
 		}
 		build := *service.Build
+		labels := getImageBuildLabels(project, service)
 
 		args := types.Mapping{}
 		for k, v := range resolveAndMergeBuildArgs(s.dockerCli, project, service, options) {
@@ -209,7 +210,7 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
 			Dockerfile:       dockerFilePath(build.Context, build.Dockerfile),
 			DockerfileInline: strings.ReplaceAll(build.DockerfileInline, "${", "$${"),
 			Args:             args,
-			Labels:           build.Labels,
+			Labels:           labels,
 			Tags:             append(build.Tags, api.GetImageNameOrDefault(service, project.Name)),
 
 			CacheFrom:    build.CacheFrom,