Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure: docker build -t yourname/app . #117

Open
systemlevel opened this issue Aug 27, 2018 · 6 comments
Open

Failure: docker build -t yourname/app . #117

systemlevel opened this issue Aug 27, 2018 · 6 comments

Comments

@systemlevel
Copy link

systemlevel commented Aug 27, 2018

This is what I get when I take build the Dockerfile containing:

FROM jshimko/meteor-launchpad:latest

screen shot 2018-08-27 at 12 34 29 am

Any ideas?

@adammendoza
Copy link

Same here. We you able to get it fixed or moved to a new image?

@bergjs
Copy link

bergjs commented Oct 28, 2018

any news here? I have a similar problem ...

@jshimko
Copy link
Owner

jshimko commented Oct 28, 2018

The error in the above image is from node-gyp doing a binary build of one of the app's dependencies. In other words, that's app-specific.

To start (at least for the image above), I recommend figuring out what package depends on the gl and decide if you actually need it. If you, figure out what build dependencies that package actually needs. If it's a common enough dependency, I'll just add it to the image.

However, I suspect the 3 of you are probably having this issue for 3 different reasons (or 3 different packages in this case). But maybe not. ?

I'll need more info to help any further. If you can put together a repo that reproduces this problem with the least amount of code possible to cause issue, I'd be happy to take a look.

@bergjs
Copy link

bergjs commented Oct 28, 2018

Thanks for offering to look into this! I will have to see if I can manage to get a small repo set up. For now, maybe you can point me to the right direction based on this screenshot:

grafik

@jshimko
Copy link
Owner

jshimko commented Oct 28, 2018

@bergjs Oh boy, that's a classic. :)

To confirm my assumption, remove bcrypt from your package.json and run the build to see if it works. When it does (it likely will), you have two fairly simple options to fix it.

Option 1 (probably the ideal)

Start building with this (somewhat inconvenient) build flag to adjust the amount of available memory available to the Node process that's being used during the build...

docker build \
  --build-arg TOOL_NODE_FLAGS="--max-old-space-size=2048" \
  -t  yourname/app .

For a LONG conversation and a bunch of links/background, see this issue conversation from last year...

reactioncommerce/reaction#3023 (comment)

You may need to adjust that 2048 value depending on a range of factors, but start there. I've found that either 2048 or twice that at 4096 tends to work in most build environments. So yeah, a really fun and hard to diagnose problem.

Much has been written about that at this point, but I'm not sure if anyone has actually "fixed" it beyond my suggestions above.

Option 2

Remove bcrypt and go on with your day.

npm uninstall -S bcrypt

It's worth noting that Meteor will function completely fine without bcrypt installed. It's just used for hashing passwords in the accounts package. When bcrypt is missing, the Meteor accounts package falls back to doing the same thing but with javascript (instead of the bcrypt binary) - which is slightly slower, but let's be honest... how often is hashing passwords really happening in your app? Login, password update, and initial account creation. That's literally it. Hardly something that's going to slow your app down in a noticeable way unless you have thousands of users.

For everyone else in this thread, I recommend trying the same thing I mentioned in option 1. It's quite possible that it's the same issue. It seems to be fairly common when the build needs to do compilation of binaries.

Let me know how it goes!

@bergjs
Copy link

bergjs commented Oct 28, 2018

Hey @jshimko, great advice! Thanks so much! It builds indeed without bcrypt. I think I'll just go without it. I wasn't aware anymore that Meteor works without bcrypt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants