Add --build-arg PRE_INSTALL_SCRIPT to improve build time #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.