#8530 Container images are produced with weak dependencies installed
Closed: Fixed 3 years ago by amoloney. Opened 4 years ago by ignatenkobrain.

⋊> ~ podman run -it --rm registry.fedoraproject.org/fedora:rawhide bash
[root@e0f7ef39e0fd /]# dnf -C remove python3-unbound
Failed to set locale, defaulting to C.UTF-8
Dependencies resolved.
===============================================================================
 Package               Architecture Version              Repository       Size
===============================================================================
Removing:
 python3-unbound       x86_64       1.8.3-4.fc30         @anaconda       532 k
Removing unused dependencies:
 libevent              x86_64       2.1.8-5.fc30         @anaconda       976 k
 unbound-libs          x86_64       1.8.3-4.fc30         @anaconda       1.5 M

Transaction Summary
===============================================================================
Remove  3 Packages

Freed space: 3.0 M
Is this ok [y/N]: 

Is there any specific reason why container image builds do not set install_weak_deps=False?


I guess we can save 14M by removing this unneeded stuff:

===============================================================================
 Package                     Arch    Version                  Repository  Size
===============================================================================
Removing:
 deltarpm                    x86_64  3.6.2-1.fc31             @anaconda  299 k
 mkpasswd                    x86_64  5.4.3-1.fc31             @anaconda  108 k
 openssl-pkcs11              x86_64  0.4.10-1.fc31            @anaconda  358 k
 python3-pip                 noarch  19.1.1-1.fc31            @anaconda  7.5 M
 python3-unbound             x86_64  1.8.3-4.fc30             @anaconda  532 k
 rpm-plugin-systemd-inhibit  x86_64  4.15.0-0.beta.1.fc31     @anaconda   18 k
 sssd-client                 x86_64  2.2.0-3.fc31             @anaconda  258 k
Removing unused dependencies:
 dbus-libs                   x86_64  1:1.12.16-1.fc31         @anaconda  461 k
 libevent                    x86_64  2.1.8-5.fc30             @anaconda  976 k
 libsss_idmap                x86_64  2.2.0-3.fc31             @anaconda   78 k
 libsss_nss_idmap            x86_64  2.2.0-3.fc31             @anaconda   89 k
 openssl                     x86_64  1:1.1.1c-4.fc31          @anaconda  1.2 M
 unbound-libs                x86_64  1.8.3-4.fc30             @anaconda  1.5 M
 whois-nls                   noarch  5.4.3-1.fc31             @anaconda  102 k

Transaction Summary
===============================================================================
Remove  14 Packages

Freed space: 13 M

Actually, there are more of them. We can save 17M :)

you can use fedora-minimal, which is created without the weak deps.

I have started to remove some of the not needed packages from the main base image but feel free to open a pull request to https://pagure.io/fedora-kickstarts :-)

fedora-minimal uses microdnf so it is not desirable for many cases. And you really don't need those weak deps in normal images either...

I mean, what is the point of pulling packages which are never used in containers?

  • python3-unbound which works only when unbound is running (which is usually done via systemd)
  • rpm-plugin-systemd-inhibit which works only if you have systemd/logind running

I'm pretty sure other packages are useless in containers as well. My goal here is to have working (and useful, whatever that means) small Fedora container images.

This is all fine with me, as I said in my previous comment feel free to open a PR to the kickstarts repo.
I guess we can start by making this change in rawhide first.

@cverna oh, then I misunderstood you. Can you help me to find place where I can put setting to not install weak deps?

This issue has been fixed using above PR

Metadata Update from @amoloney:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #551 Merged 4 years ago