From e8fd539b8cbb0f62e1a80c1a1d0579e1830526b2 Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Thu, 25 Jul 2019 06:52:29 +0000 Subject: [PATCH] Remove not needed files from the container base image. This brings some of the fedora-minimal optimization to the fedora base image. We remove the timezones info, default fonts and some logs. Signed-off-by: Clement Verna --- fedora-container-base.ks | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fedora-container-base.ks b/fedora-container-base.ks index 3d7f801..493a9ff 100644 --- a/fedora-container-base.ks +++ b/fedora-container-base.ks @@ -15,6 +15,7 @@ sssd-client sudo -glibc-langpack-en -cracklib-dicts +-dejavu-sans-fonts %end %post --erroronfail --log=/root/anaconda-post.log @@ -46,6 +47,18 @@ umount /run systemd-tmpfiles --prefix=/run/ --prefix=/var/run/ --create --boot || true rm /run/nologin # https://pagure.io/atomic-wg/issue/316 +# Remove some dnf info +rm -rfv /var/lib/dnf + +# if you want to change the timezone, bind-mount it from the host or reinstall tzdata +# Work around waiting for a tzdata-minimal package see https://bugzilla.redhat.com/show_bug.cgi?id=1733452 +rm -fv /etc/localtime +mv /usr/share/zoneinfo/UTC /etc/localtime +rm -rfv /usr/share/zoneinfo + +# Final pruning +rm -rfv /var/cache/* /var/log/* /tmp/* + %end %post --nochroot --erroronfail --log=/mnt/sysimage/root/anaconda-post-nochroot.log