Strip some excess from the centos dib image

Strips postfix gcc make from Centos based builds in
an attempt to reduce the overall sie of the ramdisk as C development
utilties are not needed on a ramdisk and better to not have present
on a machine as it complicates attacks to take over and launch to
additional hosts.

Postfix is also present in the ramdisk and is not needed as the
ramdisk has no use for a mail transport agent.

Also removes the GeoIP data files which are not needed by the ramdisk.

Change-Id: I7627e8a3d4924a672af37a468870ba92604e2e66
This commit is contained in:
Julia Kreger 2020-07-18 13:53:59 -07:00
parent 541e8587a8
commit a1c3a1668a
2 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,7 @@ sudo find . -xdev \
-path './usr/lib/locale/*' -prune -o \
-path './usr/share/doc/*' -prune -o \
-path './usr/share/man/*' -prune -o \
-path './usr/share/GeoIP/*' -prune -o \
-path './usr/share/info/*' -prune -o \
-path './usr/share/licenses/*' -prune -o \
-path './usr/share/locale/*' -prune -o \

View File

@ -11,6 +11,7 @@ rm -rf /tmp/ironic-python-agent
# TODO(dtantsur): implement the same for debian-based systems
case "$DISTRO_NAME" in
fedora|centos|centos7|rhel|rhel7)
${YUM:-yum} remove -y postfix gcc make
${YUM:-yum} clean all
# Rebuilding the rpm database after removing packages will reduce
# its size