-
Notifications
You must be signed in to change notification settings - Fork 3
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
Understanding nodejs-yarn And Caching #921
Comments
@brockwood This looks like an unintended side-effect of supporting Yarn's Plug'n'Play feature which, due to the buildpack configuration, requires the I believe this will need to be addressed by adding code to detect when Keep in mind, these Cloud Native Buildpacks are currently in preview so issues are to be expected. Your feedback here is definitely appreciated! |
@colincasey Thank you for the detailed reply. One final question since this is fresh in your mind. I have found that if I perform a build and specify |
That's an interesting workaround @brockwood 😄 Where that approach might run into trouble:
Another option would be to modify the image during the build phase using an inline buildpack to strip out the contents of the Yarn cache without messing with other layers. For example, if you added a [_]
schema-version = "0.2"
[[io.buildpacks.group]]
id = "heroku/nodejs"
version = "3.2.13"
[[io.buildpacks.group]]
id = "yarn/delete-cache"
[io.buildpacks.group.script]
api = "0.10"
inline = """
echo "===> Deleting yarn cache"
rm -rf /layers/heroku_nodejs-yarn/deps/cache
""" You could also combine this technique with yours to keep build caching of modules run a couple scripts that:
|
Greetings,
First off, thank you for this buildpack. We're currently exploring deploys that can target both Heroku and a Docker platform and this seems like a good fit.
One area that we are having an issue with is image size. When running
pack build
, the resulting Docker image is gigabytes bigger than trying to build this directly with aDockerfile
. Whileexec
'ing into the final image, we've discovered that/layers/heroku_nodejs-yarn/deps/cache
contains the cached Nodejs modules from theyarn
install which, for our app, is over 1.5 gigabytes in size. Most likely due to my limited understanding, I've tried to get around this by using the flag--publish
along with--cache-image
but the final app image still contains all the saved zip file data. Reading docs for the build process, it is not obvious if there's a workaround for this behavior. Is it possible to limit theheroku/nodejs-yarn:deps
layer to the cache image? Or, if this isn't the right place to ask, do you have a recommendation where I should direct this question? Thank you for your time.The text was updated successfully, but these errors were encountered: