-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Compose V2 doesn't seem to allow you to stop running builds in parallel, stopping solution from building. #9091
Comments
docker compose v2 uses BuildKit by default, you can force use of the legacy "classic" builder setting Can you please check you can build this Dockerfile by |
We are not able to switch from docker-compose 1 to docker-compose 2. I really wonder why the parallel build issues are not addressed at all. Using the same command to build our solution with docker-compose v2 causes our build server to crash completly cause it's out of memory and CPU and starts to kill random processes cause of OOM. Setting buildkit to 0 causes the build to take 30 minutes instead of 15 with docker-compose v1. I made a buildx issue 2 years ago: docker/buildx#359 There is no flag to specify how many parallel jobs are run...there is no flag to specify memory and cpu... Are we the only ones using docker-compose with more then just a simple TODO App? |
I have a different issue but really similar to yours, when I run docker compose build all the dependencies of my services are downloaded at the same moment and some service get their dependecies, others just timeout ... I don't understand why there is not a simple flag telling "build image one after another" |
We are also having this issue at my org. We have 9 dotnet containers that rebuild at the same time when running |
Same issue here. Getting the same
|
Another one with the same issue. It feels dumb to run multiple build commands, one for each image, due to the missing flag. |
I have the same issue with our system that has a little over 30 .net containers (and growing). To answer the question from @ndeloof above, at least in our case building a container with build kit works, in fact we build all of our containers with buildkit and compose v1. How does compose v2 decide how many builds to start at once? We did see issues with pulls from our registries as @rowanmoul described but we solved that with buildkit RUN --mount=type=cache. However as far as I can tell compose just loops over the list of services and spawns a build for each, and building 30+ applications at once is bound to fail on any workstation. If you are running on a Mac/Linux computer you may be able to set something in |
Compose v2 indeed fully delegates service image build to buildkit. |
@ndeloof thanks for the quick response but as I indicated above for those of us on windows i.e. Docker Desktop that option is not exposed. see moby/buildkit#2906 (comment). In short there is no configurable buildkitd.toml file. The docker team seems to be ignoring/missing that fact, consistently stating buildkitd.toml as a solution to this issue. I checked out the code to see if I could implement a solution but there are many barriers to overcome for example when following the developer setup guide
Anyway after spending a little over a day trying to get a simple build working I gave up and left my needs in the hands of those working on the project in hopes they recognize the gap in what is provided and the suggested solution. |
Yes, we need to offer a better way to manage this concurrent build issue. I just shared the link for documentation. |
@ndeloof I do appreciate your help but maybe I am missing something. The documentation you linked https://github.com/docker/buildx/blob/master/docs/guides/resource-limiting.md#max-parallelism does not have any explanation on how to do this on windows. It seems very Linux oriented in particular it talks about configuring the Linux daemon using |
I can't tell about configuration with WSL2, buildkit issue #2906 is the right place to get an answer |
I created another builder using I am ok going with a sequential build like compose v1 if needed because it does succeed, however I would like to take advantage of some of the newer features like mounting build secrets provided by compose v2. From what I can tell in the build output (I may be reading something wrong) the max-parallelism setting has no effect on the number of containers being concurrently built by compose. My guess is that max-parallelism only impacts the number of concurrent builds within a single image for example in our multi-stage docker files we have a we have a UI build and REST api build that happen in parallel and are combined in the final image with For reference here is my config and I have attached the first 2,000 lines (few seconds) of the output from
|
@fuzzybair good point. Added support for COMPOSE_PARALLEL_LIMIT in |
Does this still work? I'm not seeing in the docs any mention of it being deprecated and my new upgraded compose just started ignoring |
Description
I have a docker-compose file that runs 10 .Net Microservices, after upgrading to Docker Desktop 4.3.2, Docker Engine v20.10.11, when I try to do 'docker-compose up --build' whilst Docker Compose v2 is enabled, the following issue happens:
When I run 'docker-compose disable-v2', the issue is resolved and the builds run sequentially.
Steps to reproduce the issue:
Describe the results you received:
Build run in parallel and error:
Describe the results you expected:
Build runs in either parallel or sequential and pass.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker compose version
:Output of
docker info
:Additional environment details:
The text was updated successfully, but these errors were encountered: