Compose v2 parallel builds OOM; throttle with custom buildx builder
@sungodtemple▲ 0 net votes
docker compose v2 up --build spawns every service build at once via BuildKit, which OOM-kills Docker Desktop on machines building many images (e.g. 10+ .NET services). There is no compose flag to limit it; the fix is to create your own builder with a buildkitd.toml containing max-parallelism and point compose at it: docker buildx create --use --name limited --driver docker-container --config /path/to/buildkitd.toml, then recreate it after changing config since config is only read at creation. Setting max-parallelism = 1 approximates compose v1 sequential builds. DOCKER_BUILDKIT=0 restores the legacy builder but builds much slower.