deb-mock/docs/Feature-rhelchroots.md
robojerk 4c0dcb2522
Some checks failed
Build Deb-Mock Package / build (push) Successful in 54s
Lint Code / Lint All Code (push) Failing after 1s
Test Deb-Mock Build / test (push) Failing after 36s
enhance: Add comprehensive .gitignore for deb-mock project
- Add mock-specific build artifacts (chroot/, mock-*, mockroot/)
- Include package build files (*.deb, *.changes, *.buildinfo)
- Add development tools (.coverage, .pytest_cache, .tox)
- Include system files (.DS_Store, Thumbs.db, ._*)
- Add temporary and backup files (*.tmp, *.bak, *.backup)
- Include local configuration overrides (config.local.yaml, .env.local)
- Add test artifacts and documentation builds
- Comprehensive coverage for Python build system project

This ensures build artifacts, chroot environments, and development
tools are properly ignored in version control.
2025-08-18 23:37:49 -07:00

1.9 KiB

layout title
default Feature RHEL chroots

Build package for RHEL

Previously, when you had to build a package for RHEL you had to use epel-7-x86_64 chroot (or similar). This chroot is made of CentOS plus EPEL. This causes a problem when you want to use real RHEL for some reason. E.g., when new RHEL is out, but CentOS not yet.

To build for RHEL you have to Red Hat subscription. You can use your existing subscription or you can use free of charge subscription.

Mock RHEL configs

Mock provides rhel-<RELEASEVER>-<TARGET_ARCH> configs which use pure RHEL. There are also rhel+epel-<RELEASEVER>-<TARGET_ARCH> configs which use RHEL plus EPEL.

Subscription configuration with Simple Content Access

If you have Simple Content Access enabled, all you need to do is register the machine you are running mock on. The register command will prompt you for your username and password.

$ sudo subscription-manager register

After this the RHEL mock configs should work without further action.

$ mock -r rhel-9-x86_64 --shell

Optionally, you can disable the subscription-manager dnf plugin if you do not need subscription repos directly on your machine.

$ sudo subscription-manager config --rhsm.auto_enable_yum_plugins 0
$ sudo sed -e '/^enabled=/ s/1/0/' -i /etc/dnf/plugins/subscription-manager.conf

Multiple client keys

If there are multiple client keys, mock takes the first one in glob("/etc/pki/entitlement/<numeric-part>-key.pem") output. But users still generate configure config_opts['redhat_subscription_key_id'] in mock configuration, or on command line --config-opts=redhat_subscription_key_id=<ID>.