If your computer is running out of memory during a docker build, or if the build is CPU intensive, you might want to try building one architecture at a time.
When creating the builder instance, specify a buildkitd config file with --config
that limits the concurrency.
Create buildkitd.toml
:
[worker.oci]
max-parallelism = 1
And run:
docker buildx create --use --name multiarch-limit --node multiarch-limit0 --config buildkitd.toml
Future builds should hopefully not crash with out of memory errors. :)
Documentation: https://docs.docker.com/build/buildkit/configure/#max-parallelism