cancel
Showing results for 
Search instead for 
Did you mean: 
Chetan_Tiwary_
Community Manager
Community Manager
  • 209 Views

Bootable Containers and RHEL Image Mode

Containers and Linux have always gone hand-in-hand. But until now, there was a clear divide. One was the Linux on your host. The other was inside your containers. Each needed separate tools and setups.

Red Hat is changing that.

With Image mode for RHEL, you can now build and manage a full Linux OS as a container image. This makes life simpler for developers and sysadmins.

What are Bootable Containers?
Bootable containers look like regular containers but include the full Linux kernel and hardware drivers. This lets them work as a full OS. You can use them in the same way you use normal container images.

 

Chetan_Tiwary__2-1751659182040.png

 

 

You know, what's really great about these bootable container images is that they behave just like any other container image you're used to. This means you can build them effortlessly using tools like Podman or Buildah, and then push them to or pull them from an image registry such as Red Hat Quay.

Essentially, you get to leverage all the same familiar tools for your bootable containers as you would for your everyday application containers. This newfound consistency opens up a fantastic possibility - you can now employ a single, unified CI/CD workflow, use the same image scanning tools, and so much more, whether you're deploying an entire operating system or just a standard application.

Building Disk Images: Your OS, Now in a Container!

One of the most exciting ways to leverage a bootable container as an operating system is by transforming it into a full-fledged disk image.

It helps you generate a variety of disk image formats depending on your deployment needs:

raw: Widely supported by virtualization platforms

qcow: Used mainly with QEMU and KVM

iso: Ideal for creating bootable USB drives 

vmdk: Used with VMware Workstation and ESXi

ami: Ready for use in Amazon EC2 environments

These image formats make it easy to run bootable containers in multiple environments—whether you're booting from a USB stick, launching a virtual machine, or spinning up a cloud instance.

https://github.com/osbuild/bootc-image-builder 

Chetan_Tiwary__0-1751658638754.png

The bootc tool can also apply a container image as an update to an existing Linux system. It does this by replacing the contents of the system’s /usr and /boot directories with those from the new image, while keeping the rest of the system intact.

By default, systems using bootc automatically update themselves when a new version of the container image is tagged in the registry, making OS updates as simple and consistent as updating a container.

Podman Desktop or Podman CLI  provides an easy way to get started with bootable containers and building disk images.

When you are ready to build a disk image, you’ll need to install the Bootable Containers extension in the Podman Desktop and you can also  install the Red Hat Extension Pack, which gives you all extensions for seamless working.

https://github.com/redhat-developer/podman-desktop-redhat-account-ext 

 

Have a look at the sample Containerfile which one can use to build the image in the Podman Desktop :

#Pull RHEL10 bootc image
FROM registry.redhat.io/rhel10/rhel-bootc

#Install LAMP components
RUN dnf install -y httpd mariadb mariadb-server php-fpm php-mysqlnd && \
    dnf clean all

#Enable services to start automatically
RUN systemctl enable httpd mariadb php-fpm

#Create a home page
RUN echo '<h1 style="text-align:center;">Welcome to RHEL image mode</h1> <?php phpinfo(); ?>' > /var/www/html/index.php

# Set the CMD to start httpd and mariadb
CMD ["/usr/sbin/init"]

 

Once you build an image using this Containerfile, you can convert this into disk image and then you can boot a new machine, start a VM, or create a virtual server in the cloud.

Refer this learning path to build and run bootable container image with image mode for RHEL and Podman Desktop : 

https://developers.redhat.com/learn/rhel/build-and-run-bootable-container-image-image-mode-rhel-and-... 

 

 

Labels (5)
0 Replies
Join the discussion
You must log in to join this conversation.