-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
When creating images like this, they are still quite large due to locale.
Consider adding steps from containers/buildah#532 to your Dockerfiles.
E.g., for me, this here saved 200MB (build from fedora container, RHEL 8 would be the same). I'm not sure about --setopt=override_install_langs=en_US.utf8 in the context of Fedora / RHEL 8, the CLI argument might be different:
buildah unshare # only needed when not root, this will drop you in a new namespace
buildah from scratch
scratchmnt=$(buildah mount working-container)
yum install -y --releasever=32 --installroot=$scratchmnt --setopt install_weak_deps=false --setopt=tsflags=nodocs --setopt=override_install_langs=en_US.utf8 nodejs
rm $scratchmnt/usr/lib/locale/locale-archive* # this was needed as in my fedora32 environment, the lang override did not work
find $scratchmnt/usr/share/locale/ \! -name '*en*' -exec rm -rf \{\} \; # this was needed as in my fedora32 environment, the lang override did not work
rm -Rf $scratchmnt/var/cache/*
rm -Rf $scratchmnt/var/lib/rpm
Metadata
Metadata
Assignees
Labels
No labels