2 ms·
Assuming 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, compil
by TomBombadildoze 7y ago
Assuming 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.