Unexpected unneeded packages

Making an image, with this in the beginning:

FROM registry.fedoraproject.org/fedora-minimal:44

COPY dnf.conf /etc/dnf/dnf.conf

RUN dnf --assumeyes \
        install \
        curl ffmpeg git ripgrep tar xz

The dnf.conf is:

[main]
gpgcheck=1
clean_requirements_on_remove=True
install_weak_deps=False
tsflags=nodocs

Dependencies should be fairly small:

$ dnf repoquery --depends curl ffmpeg git ripgrep tar xz | wc -l
Updating and loading repositories:
Repositories loaded.
47

Definitely nothing which should pull in the whole Wayland and parts of Gnome.

Yet, when podman build runs it on Fedora 44 Workstation, it does, pulls a bunch of GUI and other auxiliary packages (331 total). I can’t seem to be able to figure out what triggers it.

What is a way to limit the dnf install scope?

The ffmeg does requires a bunch of gui stuff, and that can be satisfied by different set of packages. If you don’t specify the desktop environment, it is a bit arbitrary which gui packages will be included to satisfy the requirements. If you don’t want any gui stuff, then leave out the ffmpeg package.

Removing ffmpeg from the command reduces the list indeed. It is required in this project, though, so other things start to break.

A couple follow-up questions:

  1. Where do you see the dependencies? The query returns none:
    $ dnf repoquery --depends ffmpeg | wc -l
    Updating and loading repositories:
    Repositories loaded.
    0
  1. This is for a minimal and lightweight container to run an agent, which requires ffmpeg for processing visuals. How do people deal with that bloat if ffpmeg is needed in an image?

Well, the correct dependency chain starts with sdl2-compat, and branches from there. The reason it was not visible on the ffmpeg package is because it is actually ffmpeg-free package, and dnf completely obfuscates the fact, so annoying.

I did not find a way for decline this crazy dependency tree. For now I am sourcing ffmpeg.org’s pre-build static binaries to get around this nasty. But will think hard to pick another setup (maybe not Fedora) for the next project.