8

My Dockerfile uses base image registry.access.redhat.com/ubi8/ubi-minimal which has microdnf package manager.

When I include following snippet in docker file to have latest updates on existing packages,

RUN true \
    && microdnf clean all \
    && microdnf update --nodocs \
    && microdnf clean all \
    && true

It's not just upgrades 4 existing packages but also install 33 new packages,

Transaction Summary:
 Installing:       33 packages
 Reinstalling:      0 packages
 Upgrading:         4 packages
 Removing:          0 packages
 Downgrading:       0 packages

The dnf documentation does not suggest that it should install new packages. Is it a bug in microdnf?

microdnf update also increases the new image size by ~75MB

JRomio
  • 2,407
  • 3
  • 26
  • 27
  • which base version did you use? I did not have this. At least from the https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8?architecture=arm64&tag=8.2-339, there will be a package number. Currently it has 111 and in previous version it is 99. You version may be a little old. – 4t8dds Sep 11 '20 at 04:07

1 Answers1

5

I had the same or a very similar problem. Found a command-line flag that helped to lower the number of additionally installed packages. If you add install_weak_deps=0, it should help with these additional packages.

microdnf upgrade \
  --refresh \
  --best \
  --nodocs \
  --noplugins \
  --setopt=install_weak_deps=0