- 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.
1.3 KiB
| layout | title |
|---|---|
| default | Feature buildroot image |
Starting from version v6.0, Mock allows users to use an OCI container image for pre-creating the buildroot (build chroot). It can be either an online container image hosted in a registry (or cached locally), or a local image in the form of a tarball.
Be cautious when using chroot-compatible images (e.g., it is not advisable to
combine EPEL ppc64le images with fedora-rawhide-x86_64 chroot).
Example Use-Case
-
Mock aggressively caches the build root, so clean up your chroot first:
$ mock -r fedora-rawhide-x86_64 --scrub=all -
Perform any normal Mock operation, but select the OCI image on top of that:
$ mock -r fedora-rawhide-x86_64 \ --buildroot-image registry.fedoraproject.org/fedora:41 \ --rebuild /your/src.rpm
Using Exported Buildroot Image
The export_buildroot_image plugin allows you to wrap a prepared buildroot as an OCI archive (tarball). If you have this tarball, you may select it as well:
$ mock -r fedora-rawhide-x86_64 \
--buildroot-image /tmp/buildroot-oci.tar \
--rebuild /your/src.rpm
Again, ensure that you do not combine incompatible chroot and image pairs.