You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install packages without docs to reduce image size
The UBI 8/9/10 base images ship almost no documentation of their own, but
they do not set tsflags in /etc/dnf/dnf.conf, so every dnf install and
dnf update we run installs docs and man pages into the layers we ship.
They grow the image for no runtime benefit and get picked up by CI
scanners; #772 hit this when the perl docs pulled in by git were flagged
for containing sample secrets.
Pass --nodocs to the transactional dnf calls in the RHEL driver and vGPU
Manager images, the same way #772 did for git and wget. dnf module enable,
versionlock, config-manager, remove and autoremove are left alone.
Because this relies on the flag being present at each call, add
tests/check-nodocs.sh and run it in CI. It joins continuation lines before
matching, so a command split across lines is still seen as one command,
and splits each command on &&, ||, ; and | so a chain only passes if every
transaction in it carries the flag.
The Ubuntu images need no change: the official ubuntu base images ship
/etc/dpkg/dpkg.cfg.d/excludes, which already excludes /usr/share/doc and
/usr/share/man, so dpkg never writes them.
Signed-off-by: Abrar Shivani <ashivani@nvidia.com>
0 commit comments