Putting together an alpine docker image, it runs npm install and afaik doesn't keep the cache, so when used again, any install even for a single package it seems is pulling down everything again? At least it seems that way with output like this:added 267 packages from 85 contributors, removed 156 packages, updated 1550 packages and audited 23957 packages in 138.76sIn my case, I have some imagemin packages where the binaries supplied aren't compatible with Alpine linux and so they attempt to build them. I've already got them via the package manager and want to supply those to avoid building from source(takes the image size from 100MB to 300MBish due to the npm install needing to be run out of the image by user). The packages look for example in ./node_modules/cwebp-bin/vendor/cwebp, so I copy my binaries there before running npm install yet when the package installs and runs it's post-install script(just bin-wrapper initially to look for existing binary, else download it or build it), it overrides my cwebp binary with one it downloads...(well I think it actually just removed the binary prior to installing the package, as placing the binary there after and running the install.js script works fine).Re-running the install scripts would work after, but it seems it'd need to be done for each time any other packages are added(image to be used for development).
Submitted January 02, 2019 at 05:57AM by kwhali
No comments:
Post a Comment