Repository: docker/compose

Issue:
[BUG] compose watch `--quiet` doesn't work when using `COMPOSE_BAKE`
### Description

I noticed after adding the `COMPOSE_BAKE` env variable to my project that both compose watch --quiet doesn't work, and compose up --watch also shows build logs now. These should both be quiet and not have any build logs when using bake.

### Steps To Reproduce

1. Set the `COMPOSE_BAKE` environment variable to `true`
 
2. Example code

```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```

3. Example mod file

```mod
module hello

go 1.24.2
```

4. Example Dockerfile

```dockerfile
FROM golang:alpine

WORKDIR /app

COPY . .

RUN go build -o hello .

CMD ["./hello"]
```

5. Example Compose file

```yml
services:
  hello:
    build:
      context: .
      dockerfile: Dockerfile
    develop:
      watch:
        - path: .
          action: rebuild
```

6. Run `docker compose watch --quiet` or `docker compose up --watch`

Notice how when you make a change that triggers watch, it shows build logs. Then if you remove the `COMPOSE_BAKE` environment variable, it won't have build logs.

### Compose Version

```Text
Docker Compose version v2.35.1
```

### Docker Environment

```Text
Client: Docker Engine - Community
 Version:    28.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.35.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 17
  Running: 2
  Paused: 0
  Stopped: 15
 Images: 76
 Server Version: 28.1.1
 Storage Driver: overlay2
  Backing Filesystem: btrfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.14.4-200.fc41.x86_64
 Operating System: Fedora Linux 41 (Workstation Edition)
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.26GiB
 Name: nzxt-pc
 ID: 243ae51b-a1fb-4b73-a42d-ef8cb1420620
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
```

### Anything else?

_No response_

Discussion:

Solution patch:
diff --git a/pkg/compose/build_bake.go b/pkg/compose/build_bake.go
index 31864cef..3591900e 100644
--- a/pkg/compose/build_bake.go
+++ b/pkg/compose/build_bake.go
@@ -261,6 +261,9 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
 	if options.Builder != "" {
 		args = append(args, "--builder", options.Builder)
 	}
+	if options.Quiet {
+		args = append(args, "--progress=quiet")
+	}
 
 	logrus.Debugf("Executing bake with args: %v", args)
 



Test patch:
diff --git a/pkg/e2e/build_test.go b/pkg/e2e/build_test.go
index 6061ee10..df521611 100644
--- a/pkg/e2e/build_test.go
+++ b/pkg/e2e/build_test.go
@@ -128,6 +128,11 @@ func TestLocalComposeBuild(t *testing.T) {
 			assert.Assert(t, !strings.Contains(res.Stdout(), "failed to push"), res.Stdout())
 		})
 
+		t.Run(env+" build --quiet", func(t *testing.T) {
+			res := c.RunDockerComposeCmd(t, "--project-directory", "fixtures/build-test", "build", "--quiet")
+			res.Assert(t, icmd.Expected{Out: ""})
+		})
+
 		t.Run(env+" cleanup build project", func(t *testing.T) {
 			c.RunDockerComposeCmd(t, "--project-directory", "fixtures/build-test", "down")
 			c.RunDockerOrExitError(t, "rmi", "-f", "build-test-nginx")