#7872 Container Base image contains new files
Closed: Fixed 5 years ago Opened 5 years ago by cverna.

  • Describe the issue
    It was pointed out by the docker hub team that our container base image has grown in size with it seems files for console fonts, keyboard layouts, and grub.

See diff here https://gist.github.com/docker-library-bot/ad225f360c5a0576d770b5d650192174.

The image size went up from 268MB to 312MB.

  • When do you need this? (YYYY/MM/DD)

  • When is this no longer needed or useful? (YYYY/MM/DD)

  • If we cannot complete your request, what is the impact?


So I looked a little bit more at this for some reason grub is installed in the base image but not in the minimal base image.

from the rawhide container :

~
 [cverna@laptop]  $ podman run -it --rm registry.fedoraproject.org/fedora-minimal:rawhide rpm -qa | grep grub
~
 [cverna@laptop]  $ podman run -it --rm registry.fedoraproject.org/fedora:rawhide rpm -qa | grep grub
grub2-common-2.02-62.fc30.noarch
grub2-tools-minimal-2.02-62.fc30.x86_64
grubby-8.40-18.fc30.x86_64
grub2-tools-2.02-62.fc30.x86_64

Looking at the kickstarts I don't see which package is pulling grub, but I am lacking dnf, repoquery. rpm skills.

minimal kickstarts --> https://pagure.io/fedora-kickstarts/blob/master/f/fedora-docker-base-minimal.ks

base kickstarts --> https://pagure.io/fedora-kickstarts/blob/master/f/fedora-docker-base.ks

I think this is not only grub since the minimal image size has also increased but I am starting by looking at grub.

dnf remove $rpm will tell you what all would be removed (including dependent packages) as a result of the transaction. You can use that to easily find what is requiring the grub rpms

dnf remove $rpm will tell you what all would be removed (including dependent packages) as a result of the transaction. You can use that to easily find what is requiring the grub rpms

Nice :smile:

So it seems that the guilty package here is systemd-udev but dnf remove does not seems to be very helpful in that case

[root@6d55c7ee5f06 /]# dnf remove systemd-udev                                                           
Dependencies resolved.                                                                                   
=========================================================================================================
 Package                      Arch            Version                           Repository          Size 
=========================================================================================================
Removing:                                                                                                
 systemd-udev                 x86_64          239-5.fc30                        @anaconda          7.8 M 
Removing dependent packages:                                                                             
 grubby                       x86_64          8.40-18.fc30                      @anaconda          360 k 
Removing unused dependencies:                                                                            
 cpio                         x86_64          2.12-9.fc29                       @anaconda          966 k 
 dracut                       x86_64          049-4.git20181010.fc30            @anaconda          1.0 M 
 file                         x86_64          5.34-3.fc29                       @anaconda           95 k 
 findutils                    x86_64          1:4.6.0-20.fc29                   @anaconda          1.7 M 
 gettext                      x86_64          0.19.8.1-17.fc29                  @anaconda          5.0 M 
 gettext-libs                 x86_64          0.19.8.1-17.fc29                  @anaconda          1.0 M 
 grub2-common                 noarch          1:2.02-62.fc30                    @anaconda          4.8 M 
 grub2-tools                  x86_64          1:2.02-62.fc30                    @anaconda          8.6 M 
 grub2-tools-minimal          x86_64          1:2.02-62.fc30                    @anaconda          749 k 
 hardlink                     x86_64          1:1.3-7.fc29                      @anaconda           39 k 
 info                         x86_64          6.5-11.fc30                       @anaconda          392 k 
 kbd                          x86_64          2.0.4-9.fc29                      @anaconda          1.6 M 
 kbd-legacy                   noarch          2.0.4-9.fc29                      @anaconda          499 k 
 kbd-misc                     noarch          2.0.4-9.fc29                      @anaconda          2.4 M 
 kmod                         x86_64          25-3.fc29                         @anaconda          227 k 
 kpartx                       x86_64          0.7.8-1.fc30                      @anaconda           80 k 
 libcroco                     x86_64          0.6.12-5.fc29                     @anaconda          335 k 
 libgomp                      x86_64          8.2.1-4.fc30                      @anaconda          290 k 
 libkcapi                     x86_64          1.1.3-1.fc30                      @anaconda           83 k 
 libkcapi-hmaccalc            x86_64          1.1.3-1.fc30                      @anaconda           37 k 
 os-prober                    x86_64          1.74-7.fc29                       @anaconda          113 k 
 pigz                         x86_64          2.4-3.fc29                        @anaconda          138 k 
 procps-ng                    x86_64          3.3.15-4.fc29                     @anaconda          979 k 
 systemd-bootchart            x86_64          233-3.fc29                        @anaconda          156 k 
 which                        x86_64          2.21-11.fc29                      @anaconda           87 k 
 xz                           x86_64          5.2.4-3.fc29                      @anaconda          420 k 

Transaction Summary                                                                                      
=========================================================================================================

so grubby depends on systemd-udev which depends on one of the grub packages ?

Ok I messed this up because systemd-udev is by default protected. After removing /etc/dnf/protected.d/systemd.conf I can delete systemd packages.

It appears that the extra packages are all dependencies of grubby, but grubby does not seems to be a installed by another package.

[root@e1ac8cef2bf3 /]# dnf remove grubby
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                                 Arch                                       Version                                                    Repository                                     Size
===================================================================================================================================================================================================================
Removing:
 grubby                                                  x86_64                                     8.40-18.fc30                                               @anaconda                                     360 k
Removing unused dependencies:
 cpio                                                    x86_64                                     2.12-9.fc29                                                @anaconda                                     966 k
 dracut                                                  x86_64                                     049-4.git20181010.fc30                                     @anaconda                                     1.0 M
 file                                                    x86_64                                     5.34-3.fc29                                                @anaconda                                      95 k
 findutils                                               x86_64                                     1:4.6.0-20.fc29                                            @anaconda                                     1.7 M
 gettext                                                 x86_64                                     0.19.8.1-17.fc29                                           @anaconda                                     5.0 M
 gettext-libs                                            x86_64                                     0.19.8.1-17.fc29                                           @anaconda                                     1.0 M
 grub2-common                                            noarch                                     1:2.02-62.fc30                                             @anaconda                                     4.8 M
 grub2-tools                                             x86_64                                     1:2.02-62.fc30                                             @anaconda                                     8.6 M
 grub2-tools-minimal                                     x86_64                                     1:2.02-62.fc30                                             @anaconda                                     749 k
 hardlink                                                x86_64                                     1:1.3-7.fc29                                               @anaconda                                      39 k
 info                                                    x86_64                                     6.5-11.fc30                                                @anaconda                                     392 k
 kbd                                                     x86_64                                     2.0.4-9.fc29                                               @anaconda                                     1.6 M
 kbd-legacy                                              noarch                                     2.0.4-9.fc29                                               @anaconda                                     499 k
 kbd-misc                                                noarch                                     2.0.4-9.fc29                                               @anaconda                                     2.4 M
 kmod                                                    x86_64                                     25-3.fc29                                                  @anaconda                                     227 k
 kpartx                                                  x86_64                                     0.7.8-1.fc30                                               @anaconda                                      80 k
 libcroco                                                x86_64                                     0.6.12-5.fc29                                              @anaconda                                     335 k
 libgomp                                                 x86_64                                     8.2.1-4.fc30                                               @anaconda                                     290 k
 libkcapi                                                x86_64                                     1.1.3-1.fc30                                               @anaconda                                      83 k
 libkcapi-hmaccalc                                       x86_64                                     1.1.3-1.fc30                                               @anaconda                                      37 k
 os-prober                                               x86_64                                     1.74-7.fc29                                                @anaconda                                     113 k
 pigz                                                    x86_64                                     2.4-3.fc29                                                 @anaconda                                     138 k
 procps-ng                                               x86_64                                     3.3.15-4.fc29                                              @anaconda                                     979 k
 systemd-bootchart                                       x86_64                                     233-3.fc29                                                 @anaconda                                     156 k
 systemd-udev                                            x86_64                                     239-5.fc30                                                 @anaconda                                     7.8 M
 which                                                   x86_64                                     2.21-11.fc29                                               @anaconda                                      87 k
 xz                                                      x86_64                                     5.2.4-3.fc29                                               @anaconda                                     420 k

Transaction Summary
===================================================================================================================================================================================================================
Remove  28 Packages

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

I have opened https://pagure.io/fedora-kickstarts/pull-request/452 to exclude grubby from the base image kickstart.

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

5 years ago

Login to comment on this ticket.

Metadata