You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docker buildx build got stuck if buildkit container dies #556
While build is in progress - docker exec -ti buildx_buildkit_builder-builder0 kill -s QUIT 1 where buildx_buildkit_builder-builder0 is the name of buildkit container
Have a similar issue when doing a buildx bake. It hangs on random commands. Already investigated 3 days but it is very hard to track it down.
At first I thought it is something with the hcl files, because when i changed something there and some things in the dockerfile it worked sometimes. But then I changed something again and the previous version has stopped working although it worked a couple of minutes ago.
So it works/works not based on changes you do in the files but it doesn't matter what you change it is more related to which files you touch, the order of changes of the files. We have split the configuration to multiple files, but I could also reproduce it with a single hcl file and multiple dockerfiles.
So it is probably related to some internal scheduling based on what files are changed (config, dockerfile)? Could that be?
I also found out that it is very likely related to some extend to the contexts option int the .hcl files. We use to link to other targets to implement kind of a build order. The problematic (but for our case necessary) Dockerfile commands is the COPY --from command.
The next step is trying to workaround the issue by trying to combine the individual dependent images in a single multistage image hoping that without the contexts the copy --from will not get the build process hang indefinitely.
If you need any logs, please just tell me how to get them and I can add them here.
If anyone faces the same issue, I "solved" it by removing all "contexts" from the bake-config.hcl files.
I recombined all previously separated dockerfiles to a few independent multi-stage dockerfiles. That way I could remove the "dependencies" from the bake-config.hcl files. So I didn't need to "contexts" section anymore and could remove all of them and now the build seems quite reliable locally on amd64, arm64 and on the CI system.
This doesn't solve the issue but it is a workaround.
I am facing the same issue and I want to find a trick to properly identify these leftovers and prune them regularly. Any ideas?
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ee4bc562996 moby/buildkit:buildx-stable-1 "buildkitd --allow-i…" 2 days ago Up 2 days buildx_buildkit_builder-885de0ba-d701-4918-a9a8-ce82331cebc30
6505805d2d78 moby/buildkit:buildx-stable-1 "buildkitd --allow-i…" 5 days ago Up 5 days buildx_buildkit_builder-b0bcf721-0454-4a21-836f-6f03a4f4efb80
e6dd9f70086b 32aa1a493317 "buildkitd --allow-i…" 9 days ago Up 8 days buildx_buildkit_builder-dded1ecb-4d51-4beb-944d-f8bf2e39653e0
475bfabb6ee3 32aa1a493317 "buildkitd --allow-i…" 9 days ago Up 8 days buildx_buildkit_builder-c219ed3c-04a9-4417-b6ed-5474e43da7bc0
I am facing the same issue.
while using buildx with Kubernetes driver and for some reasons if the buildkit deployments are deleted (in my case due to a spot node interruption), the build gets stuck indefinitely.
Activity
holograph commentedon Feb 21, 2022
Happens with 0.7.1 as well:
github.com/docker/buildx v0.7.1-docker 0584689
Docker version 20.10.12, build e91ed57
ceelian commentedon Apr 1, 2022
Have a similar issue when doing a buildx bake. It hangs on random commands. Already investigated 3 days but it is very hard to track it down.
At first I thought it is something with the hcl files, because when i changed something there and some things in the dockerfile it worked sometimes. But then I changed something again and the previous version has stopped working although it worked a couple of minutes ago.
So it works/works not based on changes you do in the files but it doesn't matter what you change it is more related to which files you touch, the order of changes of the files. We have split the configuration to multiple files, but I could also reproduce it with a single hcl file and multiple dockerfiles.
So it is probably related to some internal scheduling based on what files are changed (config, dockerfile)? Could that be?
I also found out that it is very likely related to some extend to the
contextsoption int the .hcl files. We use to link to other targets to implement kind of a build order. The problematic (but for our case necessary) Dockerfile commands is theCOPY --fromcommand.The overall demo project looks like this:
I also tried
--no-cacheflags and even introduced aARG CACHEBUSTbased on the idea of Sebastion on https://www.freecodecamp.org/news/docker-cache-tutorial/ but in the end I couldn't reliable reproduce the error.The next step is trying to workaround the issue by trying to combine the individual dependent images in a single multistage image hoping that without the
contextsthecopy --fromwill not get the build process hang indefinitely.If you need any logs, please just tell me how to get them and I can add them here.
My docker info:
ceelian commentedon Apr 2, 2022
If anyone faces the same issue, I "solved" it by removing all "contexts" from the bake-config.hcl files.
I recombined all previously separated dockerfiles to a few independent multi-stage dockerfiles. That way I could remove the "dependencies" from the bake-config.hcl files. So I didn't need to "contexts" section anymore and could remove all of them and now the build seems quite reliable locally on amd64, arm64 and on the CI system.
This doesn't solve the issue but it is a workaround.
ssbarnea commentedon Sep 26, 2024
I am facing the same issue and I want to find a trick to properly identify these leftovers and prune them regularly. Any ideas?
Ash-exp commentedon Jun 17, 2025
I am facing the same issue.
while using buildx with Kubernetes driver and for some reasons if the buildkit deployments are deleted (in my case due to a spot node interruption), the build gets stuck indefinitely.
create command:
build command:
docker buildx build -f Dockerfile -t XXXXXXXX --push . --network host --allow network.host --allow security.insecure --cache-to=type=local,dest=XXXXXXXX,mode=max --cache-from=type=local,src=XXXXXXXX --platform linux/amd64,linux/arm64 --provenance=false --metadata-file XXXXXXXXIs there any workarounds for this issue??
fix(ci): create buildx builder with memory limit to avoid silent OOM …
fix(ci): create buildx builder with memory limit to avoid silent OOM …