Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

How RHEL image builder complements your existing workflow

May 16, 2023
Alessandro Rossi
Related topics:
ContainersLinux
Related products:
Red Hat Enterprise Linux

Share:

    Managing heterogeneous environments can be challenging and enterprises are always implementing more elaborated workflows to support standardization across multiple infrastructures and platforms. 

    With Red Hat Enterprise Linux and Red Hat Insights, a feature that can support this process comes out of the box: image builder. In this article, we will go through the core capabilities and demonstrate how easy it is to start building the first image from scratch.

    Getting started with RHEL image builder

    Image builder is an available tool for Red Hat Enterprise Linux (RHEL) that allows users to customize and build their own image that can be used on either hypervisors or cloud providers, or built as an ISO installer to provision systems at scale using Anaconda and Kickstart for unattended installations.

    The image builder is based on the osbuild-composer upstream project and is available in RHEL as an installable package. It also offers integration with the RHEL web console, which simplifies and enables a visual way of composing and creating images.

    On a fresh system, both the web console and the image builder plug-ins can be easily installed:

    sudo dnf install -y osbuild-composer composer-cli cockpit cockpit-composer

    And enabling the respective services:

    sudo systemctl enable –now cockpit cockpit.socket osbuild-composer.socket

    After enabling the socket, it is possible to restart the osbuild-composer service:

    sudo systemctl restart osbuild-composer

    After these steps, the web console will be enabled on port 9090 of your server and you can access it with your browser, as shown in Figure 1.

    RHEL Web Console Image builder empty section
    Figure 1: Image Builder section on RHEL Web Console.

    As an alternative, the image builder is also available on Red Hat Hybrid Cloud Console as a service, but in this article we will focus on the bundled version available on RHEL. See Figure 2.

    Red Hat Insights page for Image Builder
    Figure 2: Image Builder integration on Red Hat Insights.

    What does an image look like?

    When creating an image, many aspects should be considered, such as:

    • The purpose of the image
    • Where it will be deployed
    • The packages that we want to ship with it
    • The services that will be available and running in the end system
    • Users authentication

    All these aspects can be customized in a centralized way using the image builder blueprints. Figure 3 depicts this feature.

    Blueprints are used as a skeleton for images we will build and come with a great set of customizable options that we can use to craft the resulting image, such as:

    • Kernel versions and options
    • Storage configuration and partitioning
    • Packages and services, including custom repositories
    • User management (users, group, SSH configuration)
    Configuration modal window to create image blueprint
    Figure 3: Blueprint customization step-by-step.

    Customizing the blueprint

    Once the blueprint is in place, the image builder plug-in for the RHEL web console provides a comprehensive section where we can further customize the blueprint and it will track all the customizations.

    In this specific case we are creating the golden image for a service hosting a simple LAMP application, configuring the required packages, services, and firewall rules to start using the stack right from the first boot without further intervention, as shown in Figure 4.

    Summary page on RHEL Web Console showing image customizations
    Figure 4: Image details on RHEL Web Console.

    The resulting blueprint is also available using the command-line interface composer-cli that is available as part of the packages we install.

    On the system, running the following command will allow us to review the TOML version of the blueprint, which contains all the customization we added up to now:

    sudo composer-cli blueprints show my_golden_image

    The output will produce the content of the blueprint and its customizations:

    name = "my_golden_image"
    description = ""
    version = "0.0.0"
    modules = []
    groups = []
    distro = ""
    
    [[packages]]
    name = "firewalld"
    
    [[packages]]
    name = "httpd"
    
    [[packages]]
    name = "php"
    
    [customizations]
    
    [[customizations.user]]
    name = "myadmin"
    password = "SHA256-password"
    groups = ["wheel"]
    
    [[customizations.group]]
    name = "super_admin"
    [customizations.timezone]
    [customizations.locale]
    [customizations.firewall]
    [customizations.firewall.services]
    enabled = ["http", "https"]
    [customizations.services]
    enabled = ["httpd", "mariadb", "firewalld"]
    
    [[customizations.filesystem]
    mountpoint = "/"
    size = 10106127360

    Building the golden image

    Once we define and customize the blueprint for our image, we are then ready to choose the format for our image (hypervisor, ISO, cloud image) and start building it.

    Image builder offers many output formats for images, including the following, among others:

    • Cloud providers (AWS, Azure, Google Cloud, and Oracle Cloud)
    • Hypervisors (OpenStack KVM, QEMU, VSphere)
    • RHEL for edge installer, container, and ostree commits

    From the blueprint configuration page we can click Create Image and select the desired format for our golden image we will use for our servers and create it, as shown in Figure 6.

    Modal window to generate the image with parameters
    Figure 5: Image creation wizard on RHEL Web Console.

    The interface will provide us with the building status and once the image is ready it will be possible to download and start using it. See Figure 7.

    Image builder page showing image creation status
    Figure 6: Image creation status on RHEL Web Console.

    Integrations

    All the commands we issued using the web console can be replicated using the composer-cli utility or integrating external tools with the osbuild-composer APIs making it extremely easy and versatile to bring image building, definition and QA using automation on third-party utilities.

    When it comes to Red Hat Ansible Automation Platform integrations, dedicated validated content for osbuild is available and supported to start automating image customization and building directly into existing workflows or by creating dedicated automation for them.

    When it comes to the image builder service available on the Red Hat Hybrid Cloud Console, APIs are available as well and ready to be integrated.

    Conclusion

    Red Hat image builder is a great tool to start standardizing and providing consistent content across heterogeneous environments.

    You can create and build images as well as introduce the building process as part of a workflow when releasing new versions of your custom images for your workloads or your servers and devices.

    If you are interested in learning more, don’t hesitate to contact us!

    Additional resources

    • Composing a customizable image with RHEL Image builder documentation
    • Build a golden image for your RHEL homelab with Image Builder
    • Using hosted image builder via its API
    • Self-paced interactive lab
    Last updated: May 16, 2024

    Related Posts

    • What's new in Red Hat Enterprise Linux 9.4?

    • How RHEL image builder has improved security and function

    • Customize AWS cloud images with RHEL image builder and Packit

    • Red Hat Enterprise Linux 8 Image Builder: Building custom system images

    • What’s new in vSphere on RHEL image builder

    • Customize AWS cloud images with RHEL image builder and Packit

    Recent Posts

    • How Trilio secures OpenShift virtual machines and containers

    • How to implement observability with Node.js and Llama Stack

    • How to encrypt RHEL images for Azure confidential VMs

    • How to manage RHEL virtual machines with Podman Desktop

    • Speech-to-text with Whisper and Red Hat AI Inference Server

    What’s up next?

    This cheat sheet covers the use of Red Hat Insights APIs to obtain system details and findings, as well as to interact with specific Insights applications.

    Get the cheat sheet
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue