Search code examples
dockerffmpegredhatdnfubi

How to install ffmpeg on UBI docker images?


I'm looking for a simple way to install ffmpeg in a UBI8 (ubi-minimal) docker image.

I tried running in the dockerfile the following:

RUN microdnf upgrade
RUN microdnf install ffmpeg

And I'm getting:

------
 > [7/8] RUN microdnf install ffmpeg:
#11 0.375
#11 0.375 (microdnf:1): librhsm-WARNING **: 07:58:19.229: Found 0 entitlement certificates
#11 0.375
#11 0.375 (microdnf:1): librhsm-WARNING **: 07:58:19.230: Found 0 entitlement certificates
#11 0.519 error: No package matches 'ffmpeg'
------
executor failed running [/bin/sh -c microdnf install ffmpeg]: exit code: 1

How can ffmpeg be easily installed on UBI 8?

Note: I tried referring to numerous references on the web that explain how that may be done, such as this one and this as well, but UBI seems to be working differently.


Solution

  • Short answer: you can't... Even if you enable rpmfusion where ffmpeg is (like shown in the links you pointed to), the SDL2 package, which is a dependency, is not available in the UBI lines (either UBI8 or UBI9). Even adding Epel, CodeReadyBuilder,... SDL2 is the missing item you cannot get.

    Closest thing to UBI you will get is through CentOS Stream. This is what I do in many cases where UBI does not not work (and there are a lot...). As it's almost identical to RHEL, people who want support can build from it directly with almost the same Dockerfile.

    Now, if you don't distribute what you are building and you have the proper RHEL licences, you can always build your Dockerfile starting from UBI8, register, add ffmpeg (which will work because you will get SDL2 from registered RHEL repos), and unregister. Kind of a Frankenstein image... But if you have RHEL licences and don't intend to distribute, you'd better build a pure RHEL-based container image.