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

Add --build-arg PRE_INSTALL_SCRIPT to improve build time #88

Open mklueh opened 6 years ago

mklueh commented 6 years ago

I´ve added a new arg PRE_INSTALL_SCRIPT that let´s you do heavy installation tasks before the Meteor installation.

The problem is that with every build the Node and Meteor packages get redownloaded and the application gets rebuilded which invalidates the cache of all following layers.

In my case I needed to install the Android SDK into the image which lead to build times of over 30-40 min because it got installed again every single time, although it usually doesn´t get updated too often.

Maybe it would also make sense to split up the RUN statement and separate the Meteor, Node and Mongo installation from the application build and also implement caching for NPM. This would speed up things a lot more.