jshimko / meteor-launchpad

A base Docker image for Meteor applications.
https://hub.docker.com/r/jshimko/meteor-launchpad/
MIT License
276 stars 152 forks source link

Build error 137 during meteor build in CI only #109

Open wernight opened 6 years ago

wernight commented 6 years ago

I can docker build . locally but in CI this doesn't work. Sadly the script outputs don't detail much:

Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
directory will be incorrect if you ever attempt to perform any Meteor tasks as
a normal user. If you need to fix your permissions, run the following command
from the root of your project:

  sudo chown -Rh <username> .meteor/local

/opt/build_scripts/build-meteor.sh: line 27:  4542 Killed                  meteor build --directory $APP_BUNDLE_DIR --server-only
The command '/bin/sh -c cd $APP_SOURCE_DIR &&   $BUILD_SCRIPTS_DIR/install-deps.sh &&   $BUILD_SCRIPTS_DIR/install-node.sh &&   $BUILD_SCRIPTS_DIR/install-phantom.sh &&   $BUILD_SCRIPTS_DIR/install-graphicsmagick.sh &&   $BUILD_SCRIPTS_DIR/install-mongo.sh &&   $BUILD_SCRIPTS_DIR/install-meteor.sh &&   $BUILD_SCRIPTS_DIR/build-meteor.sh &&   $BUILD_SCRIPTS_DIR/post-build-cleanup.sh' returned a non-zero code: 137

Would be nice to get rid of that chown warning. I see only two reasons it could fail:

  1. It's using a lot of memory when building (> 1 or 2 GB just for the build).
  2. File access rights are different and this image is sensible to current file's UID/GID.

I looked a bit at memory using during a local build and it looks like it's using substantially more memory around that step (at least 1.6 GB additional). Looks like there is an option TOOL_NODE_FLAGS=--max-old-space-size=2048 (trying that now) that allows to limit memory usage. It may be nice to map error 137 to show that a suggested solution.

wernight commented 6 years ago

Found https://github.com/meteorhacks/meteord/issues/96 so it's really an out of memory issue. See also https://github.com/meteor/meteor/issues/9568

wernight commented 6 years ago

Similar to https://github.com/jshimko/meteor-launchpad/issues/41 but I'd like to have the option to put it in launchpad.conf (because I'm using GitLab Auto DevOps). I'm trying a workaround by setting ENV in Dockerfile.

wernight commented 6 years ago

bump