Configuring os-release and versions

Commonly when building a bootc system, you will want to manage and maintain your own version numbers and branding for the resulting system.

The default base images use a *-release package (e.g. fedora-release, centos-release, redhat-release, etc.) that contains key files such as /usr/lib/os-release (symlinked from /etc/os-release). For more on the os-release file, see this reference.

Injecting additional metadata

A useful starting point is updating the VARIANT fields.

For example:

Containerfile
RUN echo VARIANT="My Custom bootc OS" && echo VARIANT_ID=com.gitlab.customos.foo >> /usr/lib/os-release

Managing the version number

The base images include an OCI standard label org.opencontainers.image.version. As part of your build process, you may want to override it. When doing so, it is also recommended to update the OSTREE_VERSION in the os-release file, but this is not required. In the future, it is likely that the base images will use the newer IMAGE_VERSION key; using this now is recommended.

Replacing the os-release package

You can also entirely replace the os-release package, e.g.:

RUN dnf -y swap fedora-release generic-release --allowerasing && dnf clean all

The generic-release package is included in Fedora to denote the system is not Fedora, but is a derivative. You can fork the generic-release package and provide your own custom one here.