Creating Arbitrary Rocky Images#

Creating Images describes how to create images from the latest Rocky repos. This section describes how to create images from older Rocky repos. These examples use Rocky 9.5 and Rocky 8.5, but other versions will work similarly.

Note

To create a CentOS/Rocky 7 image on a RHEL or Rocky 8 head node, you must disable FIPS mode.

Important

If the Rocky image built is subsequently updated using yum update, then by default that updates packages to the latest minor release level, not to newer versions at the image's current minor release level. Also, yum install of additional packages may update dependency packages from their current minor release version level to the latest minor level. Such actions may result in a mixture of packages from different minor releases, which may have unintended consequences.

Using Version-Specific ISO File#

The first option is to use the ISO for the targeted version of Rocky. The ISO is used to create an ISO-based repo that is the basis for a distro. scyld-modimg is used to create the final image.

For example, use scyld-clusterctl repos and scyld-clusterctl distros with the Rocky-9.5-x86_64-dvd.iso ISO file to create a repo and distro for Rocky version 9.5, then use scyld-modimg to create an image and a boot config.

You can also use scyld-add-boot-config to perform the same result in fewer steps. Execute the following and accept all the defaults:

scyld-add-boot-config --iso /mnt/isos/Rocky-9.5-x86_64-dvd.iso

This creates a distro and repo both named Rocky-9.5-x86_64-dvd, and an image and boot config both named Rocky-9.5-x86_64-dvd.

Avoid the manual acceptance of the defaults by specifying desired names and running the command in batch mode:

scyld-add-boot-config --iso /mnt/isos/Rocky-9.5-x86_64-dvd.iso \
                      --image Rocky-9.5-Image --boot-config Rocky-9.5-Boot

View the result, which shows the default repo and the new repo as well as the default boot config and the new boot config:

[admin@head]$ scyld-clusterctl distros ls -L
Distros
  Rocky
    name: Rocky
    packaging: rpm
    release: 9
    repos
      Rocky_appstream
      Rocky_base

[admin@head]$ scyld-bootctl ls -l
Boot Configurations
  Rocky-9.5-Boot
    cmdline: enforcing=0
    image: Rocky-9.5-Image
    initramfs
      chksum: a85b01e91c26c52ebf549066c6c5fce544f3c75b
      filename: 3684fbadf53f4c8bb8a3dea24ecf778d
      mtime: 2025-01-18 16:49:06 UTC (1:14:23 ago)
      size: 33.4 MiB (34978448 bytes)
    kernel
      chksum: 73872862a49ee024bf44c4d796c96bed4d52ee43
      filename: 1d6888add971485395d943df191645c4
      mtime: 2025-01-18 16:49:07 UTC (1:14:23 ago)
      size: 6.4 MiB (6734016 bytes)
    last_modified: 2025-01-18 16:49:07 UTC (1:14:23 ago)
    name: Rocky-9.5-Boot
    release: 3.10.0-1062.el7.x86_64

Note

Creating images from some older ISOs may produce an error message beginning with ERROR: One or more repositories in the newly created image are invalid or unreachable. The scyld-modimg tool automatically retries the image creation, and if there is no subsequent error reported, then you can assume that the resulting image is useable.

Using Publicly Available Repositories#

To create the image from publicly available repositories, embed the specific version in the repo URLs. Note that the repositories for older versions of Rocky are now in the the /vault/ directory.

For example, to create a Rocky 8.5 image, use the following commands:

scyld-clusterctl repos create name=Rocky85_baseos urls=http://dl.rockylinux.org/vault/rocky/8.5/BaseOS/$basearch/os/
scyld-clusterctl repos create name=Rocky85_appstream urls=http://dl.rockylinux.org/vault/rocky/8.5/AppStream/$basearch/os/
scyld-clusterctl distros create name=Rocky85 repos=Rocky85_baseos,Rocky85_appstream

After the distro is created, use scyld-modimg to create the image. Alternatively, run the following command to create both the image and boot configuration:

scyld-add-boot-config --distro Rocky85