3 ms·
You're also supposed to delete any dependencies you no longer need after compiling. This image might be unnecessarily large. https://stackoverflow.com/question
by trishankdatadog 7y ago
You're also supposed to delete any dependencies you no longer need after compiling. This image might be unnecessarily large.
https://stackoverflow.com/questions/46221063/what-is-build-deps-for-apk-add-virtual-command/46222036 https://stackoverflow.com/questions/46221063/what-is-build-d...
- TomBombadildoze 7y agoAssuming it's even possible (there are cases where it isn't), unless you're doing the entire operation in a single RUN instruction (install dependencies, compile, remove dependencies), deleting dependencies isn't enough because they'll exist in an ancestor layer before you delete them. That leads to image bloat. This is why multi-stage builds are a thing, which the author advocates against doing.
- andoriyu 7y agoI've built openresty with tons of custom plugins in a single RUN call. It's possible. Image is tiny compared to: - debian based image for the same thing - Not deleting build-times dependencies. Author just doesn't know better. That's what happen you never build things from source yourself.