This guide demonstrates how to leverage system-reinstall-bootc
to quickly deploy a container-based operating system on AWS. We'll start with a fresh CentOS Stream 9 instance, install the necessary tool, and then convert it to a bootable container image using a standard CentOS base. This hands-on walkthrough provides the foundation for deploying immutable, containerized operating systems in your environment.
How to use system-reinstall-bootc
You can use a new or existing package mode system. For simplicity, let's deploy a new Centos Stream 9 instance on AWS. When launching the instance, make sure to select your SSH key or create a new one. You can use the default settings for the other options.
After the instance starts, connect to it via SSH using the key you selected when creating the instance.
ssh -i <ssh-key-file> cloud-user@<ip>
Then install system-reinstall-bootc
.
sudo dnf -y install system-reinstall-bootc
Now we can run system-reinstall-bootc
to convert this system to use a bootc image and reboot into it. Let's use the base centos-bootc image. When prompted, select cloud-user to import its SSH key into the bootc system.
sudo system-reinstall-bootc quay.io/centos-bootc/centos-bootc:stream9
sudo reboot
The bootc system has a new public SSH key. SSH won't like it when you try to connect to the same IP with a different key. Since we expect this, we can safely remove the entries from our known_hosts file.
ssh-keygen -R <ip>
Finally, let's connect to the bootc system. Note the bootc system is accessed via the root user with the same SSH key used earlier.
ssh -i <ssh-key-file> root@<ip>
bootc status
Next steps
Congratulations! You've now deployed a bootc image onto AWS. However, this was just a base image without any modifications. Next, try building a custom image and run the bootc switch
command to start using it, or deploy your custom image on a new machine using the same procedure outlined in this article.