Image mode for Red Hat Enterprise Linux (RHEL) with Podman

Learn how to create, update, and manage a custom, bootable Red Hat Enterprise Linux (RHEL) container image with Podman. 

No-cost RHEL for Developers subscription

The steps in this learning path were done on a workstation running Fedora Workstation.

A few simple steps are needed in order to prepare the workstation used to create the images. These include the following:

  1. Install Podman and subscription-manager onto the workstation.
  2. Authenticate Podman to registry.redhat.io to access the Red Hat Enterprise Linux (RHEL) bootc base image.
  3. Register the workstation’s subscription-manager with Red Hat in order to access RHEL packages that will be installed into the image.

Install Podman, osbuild-selinux, and subscription-manager

Follow the installation instructions for Podman. 

Note

osbuild-selinux is only needed on workstations that use SELinux.

$ sudo dnf -y install podman osbuild-selinux subscription-manager

Register subscription-manager

The workstation must be registered to a Red Hat account that has the needed subscriptions to access RHEL package repositories, if needed.

$ sudo subscription-manager register --username=seanmerrow --password=*****

Registry configuration

We’ll pull the initial RHEL bootc image from Red Hat’s registry.redhat.io to create the initial custom image. Subsequent custom images used to update the hosts can be stored on any registry the hosts have access to. 

In this example, we’ll use quay.io to store the custom images in a repository. Use the following steps to create a repository for this workflow.

  1. Sign in to quay.io using your Red Hat SSO credentials.
  2. Click Create New Repository.
  3. Enter the name of your new repository. In this case, we use rhel9-httpd.
  4. If using a free quay.io account, make the repository Public.
  5. You can keep the default of Empty Repository or choose another option.
  6. Click Create Public Repository.

You now have a repository at: quay.io/<your_account>/rhel9-httpd. For this learning path, we’ll authenticate Podman to two registries and enter the appropriate authentication credentials for each. 

  1. Add registry.redhat.io.

    $ podman login registry.redhat.io
    Username: seanmerrow
    Password: 
    Login Succeeded!
  2. Add quay.io.

    $ podman login quay.io
    Username: seanmerrow
    Password: 
    Login Succeeded!
Previous resource
Overview: Image mode for Red Hat Enterprise Linux (RHEL) with Podman
Next resource
Create the container image definition and user files