Installing additional packages in filebeat 9.X docker

I understand Filebeat’s Docker image switched in version 9.0.0 from an Ubuntu base to redhat/ubi9-minimal

The tree command thus no longer works inside the docker image, how can I install it? It doesn’t work with microdnf. To use EPEL do I need a redhat subscription?

I found some related docs from redhat (which this forum won’t allow me to link to :confused: ) but tree doesn’t seem to be available in the default package repos.

$ microdnf repolist

(microdnf:529): librhsm-WARNING **: 10:58:43.795: Found 0 entitlement certificates

(microdnf:529): librhsm-WARNING **: 10:58:43.796: Found 0 entitlement certificates
repo id                                                                       repo name
ubi-9-appstream-rpms                                                          Red Hat Universal Base Image 9 (RPMs) - AppStream
ubi-9-baseos-rpms                                                             Red Hat Universal Base Image 9 (RPMs) - BaseOS
ubi-9-codeready-builder-rpms                                                  Red Hat Universal Base Image 9 (RPMs) - CodeReady Builder

# no results:
$ rpm -qa | grep -i tree

I also enabled EPEL but it doesn’t appear to contain tree either

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

Did you install it with yum install tree after installing EPEL?

rpm -qa only returns installed package, so if it is not installed it will not return anything.

Try to use yum whatprovides tree to see what package provides it.

Hi @leandrojmp thanks for the advice, yum doesn’t appear to be available in the docker image though I think it’s just microdnf and the rpm command.

Here’s my Dockerfile for reference:

FROM elastic/filebeat:9.1.2 AS base

USER root
RUN microdnf install -y which

when I get a shell into the container after building I observe there’s no yum, yum: command
not found.

maybe this is a similar command to the one you’re suggesting:

$ microdnf repoquery  | grep -i tree

(microdnf:116): librhsm-WARNING **: 15:44:34.089: Found 0 entitlement certificates

(microdnf:116): librhsm-WARNING **: 15:44:34.091: Found 0 entitlement certificates
ostree-2025.1-1.el9.i686
ostree-2025.1-1.el9.x86_64
ostree-libs-2025.1-1.el9.i686
ostree-libs-2025.1-1.el9.x86_64

I tried microdnf install -y ostree-2025.1-1.el9.x86_64 ostree-libs-2025.1-1.el9.x86_64 just to be sure but these don’t provide the tree command.

Is it possible that such a command like tree is only available in the full version of red hat (requiring a license). Cause I don’t see it in EPEL either

ostree is not related to the tree command.

Probably, I do not use this image so I cannot confirm, but why you need tree inside the container?

You may need to build your own image for Filebeat if this is a requirement.