#18 java-*-openjdk-headless
Opened 5 months ago by cyberpear. Modified 5 months ago

There's quite a bit of fat that can be trimmed here, for a minimal container with only java inside.

The biggest and easiest win is getting rid of (downgrading or moving) cups-libs, which pulls in both the gnutls and openssl crypto stacks. Savings of 20.4 MiB, real world about 17 MiB because %_install_langs and nodocs

ca-certificates pulls in 8.3 MiB of dependencies. We can't get rid of ca-certificates, but perhaps we could minimize that package itself and shrink its dep chain. If we could get rid of coreutils{,-single}, grep, and sed deps from ca-certificates, we'd save 5.3 MiB. This would involve tweaking /usr/bin/ca-legacy to use only bash builtins (uses the ln command), and updating the preinstall scriptlet (using /bin/sh) to avoid the mv command for creating the .rpmsave files (probably so far obsolete we don't need that part of the scriptlet anymore... I think last needed was RHEL 6?)

There are several linked-in deps (via .so) that might be nice to have as optional:
alsa-lib 1.4 MiB
freetype 1.1 MiB
libjpeg-turbo 641 KiB

copy-jdk-configs brings in 2.7 MiB of deps. maybe it could be made a Recommends, for use everywhere but containers. It's needed to retain user changes to the default config files, since these java packages can be installonlypkgs (this brings in libxcrypt, lua{,-libs,-posix}, readline)

sizes tested on Fedora 32 (inside fedora:32 container) using yum --installroot=/mnt/sysimage --releasever=/ --setopt=install_weak_deps=no install java-latest-openjdk-headless coreutils-single glibc-minimal-langpack

The big win of removing cups-libs:
Before: 261M
After: 244M

For the java-11-openjdk-headless, there's also lksctp-tools at 281K -- I didn't dig to find why it's not on the java-latest-openjdk-headless package. (edit: it was added here https://src.fedoraproject.org/rpms/java-1.8.0-openjdk/c/9b9e825604ddd59cfbe6c03e25744bcdba1784a1?branch=master with message 'added requires lksctp-tools for headless subpackage to make sun.nio.ch.sctp work' -- probably should downgrade to Recommends if it's still relevant)

I'll open a PR and/or BZ for cups-libs, then link it here.


Login to comment on this ticket.

Metadata