Skip to content

Add steps to minimize locale #3

@ghost

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions