Skip to content

[BUG] <title>failed to execute bake: read |0: file already closed #13243

@Zhanbingli

Description

@Zhanbingli

Description

Environment
macOS 15.3.x (Apple Silicon – MacBook Air)
Docker Desktop 28.4.0 (context desktop-linux)
Docker Compose v2.39.2-desktop.1
Docker Engine client API 1.51
BuildKit enabled (default)
Steps to Reproduce
Clone the repository and cd medical_net
Run docker compose -f infrastructure/docker-compose.yaml up --build
The build phase fails immediately with:
failed to execute bake: read |0: file already closed
There is also a warning about the version field being obsolete; removing that field does not change the outcome.
The compose file defines several services that build from local folders (backend, etl, frontend) plus a Postgres service.
Expected Behavior
All services should build and start normally.
Actual Behavior
The command stops during the build stage with failed to execute bake: read |0: file already closed. No containers are started.

Additional Info / Workaround
Running DOCKER_BUILDKIT=0 COMPOSE_DOCKER_CLI_BUILD=0 docker compose -f infrastructure/docker-compose.yaml up --build avoids the error.
The same happens if I run docker compose -f infrastructure/docker-compose.yaml build.
Happy to provide docker compose --verbose logs or other diagnostics if needed.

Steps To Reproduce

No response

Compose Version


Docker Environment


Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions