docker-min: move /usr/share/{locale,i18n} to %post nochroot

find does not exist in the minimal image chroot so we'll have to
run it from outside.
This commit is contained in:
Dusty Mabe 2017-01-19 22:36:54 -05:00
parent 135de4a70b
commit af27549437
No known key found for this signature in database
GPG Key ID: 3302DBD73952E671

View File

@ -70,11 +70,6 @@ touch /etc/machine-id
# remove some random help txt files
rm usr/share/gnupg/help*.txt -f
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1051816
KEEPLANG=en_US
for dir in locale i18n; do
find usr/share/${dir} -mindepth 1 -maxdepth 1 -type d -not \( -name "${KEEPLANG}" -o -name POSIX \) -exec rm -rf {} +
done
# Pruning random things
rm usr/lib/rpm/rpm.daily
@ -88,3 +83,15 @@ ln usr/bin/ln usr/sbin/sln
rm -rf var/cache/* var/log/* tmp/*
%end
%post --nochroot --erroronfail --log=/mnt/sysimage/root/anaconda-post-nochroot.log
set -eux
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1051816
# NOTE: run this in nochroot because "find" does not exist in chroot
KEEPLANG=en_US
for dir in locale i18n; do
find /mnt/sysimage/usr/share/${dir} -mindepth 1 -maxdepth 1 -type d -not \( -name "${KEEPLANG}" -o -name POSIX \) -exec rm -rf {} +
done
%end