Docker – Allow more memory when docker build a Dockerfile


I try to build a Dockerfile and I get this :

Linking CXX executable ../../../../bin/clang
collect2: error: ld terminated with signal 9 [Killed]
make[2]: *** [bin/clang-3.2] Error 1
make[1]: *** [tools/clang/tools/driver/CMakeFiles/clang.dir/all] Error 2
make: *** [all] Error 2

Typically it means that I don't have enough memory.
So how do I run docker build with a bigger memory (or swap ?)

Thanks 🙂

Best Solution

Did you try increasing memory available for docker via Docker > Preferencess... > Advanced > Ram. It defaults to only 2 GB (on mac).