DNF with image mode for RHEL
Use the DNF tool within your Containerfile to manage software packages for Red Hat Enterprise Linux bootc images. This ensures that all dependencies are resolved at build time, resulting in a predictable and immutable deployment.
The rhel10/rhel-bootc container image includes the dnf package manager. You can use dnf for several use cases:
- Using
dnfas a part of a container build -
You can use the
RUN dnf installdirective in the Containerfile. - Using
dnfat runtime -
Warning The functionality depends on the
dnfversion. You might get an error:error: can’t create transaction lock on /usr/share/rpm/.rpm.lock (Read-only file system).
You can use the bootc-usr-overlay command to create a writable overlay filesystem for /usr directory. The dnf install writes to this overlay and you can use it for installing debugging tools. Note that changes are lost on reboot.
- Configuring storage
-
The supported storage technologies are the following:
xfs/ext4- Logical volume management (LVM)
- Linux Unified Key Setup (LUKS)
You can add other storage packages to the host system.
- Storage with
bootc-image-builderYou can use the bootc-image-builder tool to create a disk image. The available configuration for partitioning and layout is relatively fixed. The default filesystem type is derived from the container image’s bootc install configuration. - Storage with bootc install
You can use the
bootc install to-diskcommand for flat storage configurations andbootc install to-filesystemcommand for more advanced installations. For more information see Advanced installation with to-filesystem and to-disk.