Want to create a bootable operating system from a Containerfile? Download this extension!
Easily go from container to VM / ISO-on-a-USB / RAW image!
- Technology
- Bootable Container Images
- Read Before Using
- Example Images
- Use Case
- Requirements
- Installation
- Usage
- Contributing
The Bootable Container (bootc) extension uses bootc-image-builder in order to build bootable container disk images.
Once a machine is created from the disk image, it can apply transactional updates "in place" from newly pushed container images (without creating a new disk image). For more information, see bootc.
There are many projects at work at creating "bootc" images. Below is a non-exhaustive list of compatible images which are known to work with bootc-image-builder
.
CentOS:
- Containerfile:
FROM quay.io/centos-bootc/centos-bootc:stream9
- Repo:
quay.io/centos-bootc/centos-bootc:stream9
- Example Images: gitlab.com/fedora/bootc/examples
- Documentation: fedoraproject.org
- Notes: N/A
Fedora:
- Containerfile:
FROM quay.io/fedora/fedora-bootc:40
- Repo:
quay.io/fedora/fedora-bootc:40
- Example Images: gitlab.com/fedora/bootc/examples
- Documentation: fedoraproject.org
- Notes: Must select "XFS" or "EXT4" for the root filesystem when building in the GUI. Read more here.
RHEL:
- Containerfile:
FROM registry.redhat.io/rhel9/rhel-bootc:9.4
- Repo:
registry.redhat.io/rhel9/rhel-bootc:9.4
- Documentation: Red Hat Customer Portal
The images can then be added to your Containerfile:
FROM quay.io/centos-bootc/centos-bootc:stream9
- Fedora Building Containers Guide: provides an overview on how to create Fedora/CentOS-derived bootc images.
- Bootc General Guidance: provides a general configuration overview for bootc images.
Some concepts to grasp before using.
You are "creating" an OS straight from a Containerfile, isn't that awesome?
FIRST realize that you are creating an OS with all your applications, developer tools, even games that you want.
SECONDLY ask yourself what applications you want to have running (perhaps on boot too!).
Want a quick straight-to-the-point Hello World Containerfile?
FROM quay.io/centos-bootc/centos-bootc:stream9
# Change your root password for a "test login" that
# allows to log in on a virtual/physical console
# NOTE: While some base images may set `PermitRootLogin prohibit-password`
# for OpenSSH, not all will.
# This is VERY dangerous and only meant for Hello World purposes.
RUN echo "root:root" | chpasswd
After creating your image you can now login and explore your bootable OS.
Want to view more example images Such as httpd
and nvidia
?
All of our maintained example images are on the gitlab.com/fedora/bootc/examples repo.
You can also pull our example image based on the httpd
example:
After building, read our Virtual Machine Guide on how to launch your image and access your HTTP server.
Go from a bootc compatible derived container build to a disk image format:
qcow2
: QEMU Disk Imagesami
: Amazon Machine Imagesraw
: RAW disk image an MBR or GPT partition tableiso
: Unattended installation method (USB sticks / install-on-boot)vmdk
: Usable in vSphere
The list above is what is supported by the underlying bootc-image-builder
technology. The list can be found here.
OS:
Compatible on Windows, macOS & Linux
Software:
Podman Machine requirements:
- Rootful mode enabled
- At least 6GB of RAM allocated in order to build the disk image
Rootful mode can be enabled through the CLI to an already deployed VM:
podman machine stop
podman machine set --rootful
podman machine start
Or set when initially creating a Podman Machine via Podman Desktop:
Linux users:
On Linux, you are unable to create a Podman Machine through the GUI of Podman Desktop, to create a rootful Podman Machine you can run the following commands:
podman machine init --memory 6144 --rootful
podman machine start
This extension can be installed through the Extensions section of Podman Desktop within the Catalog tab:
- Go to Extensions in the navbar.
- Click on the Catalog tab.
- Install the extension.
A version of the extension using the latest commit changes can be installed via the Install custom... button with the following link:
ghcr.io/containers/podman-desktop-extension-bootc:nightly
- Build your bootc-enabled Containerfile:
In the example below, we are going to change the root password for testing purposes when accessing the OS.
FROM quay.io/centos-bootc/centos-bootc:stream9
# Change the root password
# CAUTION: This is NOT recommended and is used only for testing / hello world purposes
RUN echo "root:root" | chpasswd
- Build the disk image:
Build the disk image, this takes approximatley 2-5 minutes depending on the performance of your machine.
- Launching the VM:
See our Virtual Machine Guide on how to launch the image!
Preferences such as the default bootc-builder-image
as well as timeouts can be adjusted within the Preferences section of Podman Desktop.
Want to help develop and contribute to the bootc extension? View our CONTRIBUTING document.