Minimum RAM required to build reaction


TL;DR Reaction Commerce requires more than 2 GB of RAM to build

recommendation for reaction team:
add a note about minimum RAM needed to build an image to the requirements page

My Adventure

While trying to build a vanilla clone of reaction using reaction build <imageName> I ran into a strange error:

Step 1 : RUN cd $APP_SOURCE_DIR &&             bash $BUILD_SCRIPTS_DIR/ &&             bash $BUILD_SCRIPTS_DIR/
 ---> Running in ed8d087968dd
/opt/build_scripts/ line 16:     6 Killed                  npm i -g reaction-cli
The command '/bin/sh -c cd $APP_SOURCE_DIR &&             bash $BUILD_SCRIPTS_DIR/ &&             bash $BUILD_SCRIPTS_DIR/' returned a non-zero code: 137

No logs, stack traces or other info was available.
I noticed a couple of new docker images had been created, one of which had exited with the error code 137, so I started it up manually, shelled into it, and tried to run myself to see what output I got.
It crashed, gave me no additional output, the docker container exited again with code 137.

I searched around the forums and couldn’t find anything specific to this, but did find another thread which suggested I didn’t have enough RAM. It says “600MB is pushing it”, and here I was trying to do a build on a DigitialOcean droplet with only 512MB!

So I increased my RAM to 1 GB and tried again. It’s hard to get exact requirements because the installation will use as much memory as is made available to it, but I used watch -n5 free in a second shell to see what my memory looked like while the build was running. Sure enough, it was getting used up pretty quickly, and soon it crashed again. So I raised it to 2 GB. It did take longer this time, but again the memory was used up and the build failed.

At this point I gave up trying to do a build on my droplet, and am now doing them locally on my laptop.

Eventually I will automate this build process, but my ultimate goal here is to learn how to do a custom build with my own plugins, so for now I’m building manually.


I have a similar problem when trying to build an image on my local windows 10. The process exits with the same error.
Also tried to shell into the container and run the but it takes forever.
I feel completely lost :slight_smile:


Any solution to this yet?

I have been having the same problem, I don’t know what to do anymore. Something like this usually happens when there is some inescapable recursion or for/while loops. I checked and my code is fine and the only Meteor library I added is nourharidy:ssl the rest are just normal NPM libraries.


I’m getting this too - any solution?