3 ms·
Yes, but apt-get clean is still redundant [ed: because the upstream Debian/Ubuntu images automatically runs apt-clean via how dpkg/apt is configured - and your
by e12e 4y ago
Yes, but apt-get clean is still redundant [ed: because the upstream Debian/Ubuntu images automatically runs apt-clean via how dpkg/apt is configured - and your image should inherit this behavior]. Personally I'm not a fan of deleting random files like man pages and documentation - so instead of:
RUN apt-get update -qq && \
apt-get install -y build-essential libvips && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man
I'd do:
RUN apt-get update -qq && \
apt-get install -y build-essential libvips && \
rm -rf /var/lib/apt/lists/*
- cvccvroomvroom 4y agoNot a fan of violently modifying the system outside of the package manager either. rm -rf isn't configuration management, it's system entropy increasing leaving users scrambling to reinstall the world. If people don't want docs, then distro vendors should package them separately and make them recommended packages.
- e12e 4y agoIndeed. If you want a small image, there's "slim" and "alpine" variants.