Add bootc imagectl: Rust reimplementation of bootc-base-imagectl#1800
Add bootc imagectl: Rust reimplementation of bootc-base-imagectl#1800jeckersb wants to merge 1 commit intobootc-dev:mainfrom
Conversation
Implements a new `bootc imagectl` command that provides container image build tooling, reimplementing the Python bootc-base-imagectl script in Rust. This adds a new `bootc-imagectl` crate with three main subcommands: - `list`: List available rpm-ostree manifests with descriptions - `rechunk`: Generate chunked OCI images using rpm-ostree - `build-rootfs`: Build container root filesystems from manifests The build-rootfs command supports: - Custom manifests with JSON overrides - Additional package installation (--install) - OSTree directory overlays (--add-dir) - Package version locking via NEVRA/NEVR (--lock) - Repository selection (--repo) - Documentation control (--no-docs) - Sysusers configuration (--sysusers) - Build configuration reinjection (--reinject) Key features: - Full feature parity with Python implementation - Comprehensive input validation and error handling - Modular design with separate manifest, lockfile, and build modules - Automatic cleanup of temporary files via RAII - 7 unit tests covering validation and NEVRA parsing - Accessible via both `bootc imagectl` and `bootc image-build` alias Container testing shows identical output to the Python version for the list command and proper error handling for build operations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
100% just turning claude loose on "rewrite bootc-base-imagectl in rust" with some very minor nudges along the way. It did at least superficially sanity check this in a container against the python implementation, but I haven't tested anything. Just wanted to post it before disappearing for the holiday 👋 |
|
I definitely think the tool needs a rewrite and more productization, but in the current vision of this project bootc is not itself a buildsystem or tied to any specific OS or distro. Calling out to apt/dnf/rpm-ostree and such should be done in general via "plugins" if we need it - that's what we do with system-reinstall-bootc. Options:
Of course it might not be too hard for this tool to grow package abstractions, and it could become That said I think it does make sense to chip away at things from the "bottom"; a wrapper for |
|
Per discussion above, closing this, let's instead keep up momentum on the work items in #1498 as well as https://gitlab.com/fedora/bootc/docs/-/merge_requests/143 ! |
Implements a new
bootc imagectlcommand that provides container imagebuild tooling, reimplementing the Python bootc-base-imagectl script in Rust.
This adds a new
bootc-imagectlcrate with three main subcommands:list: List available rpm-ostree manifests with descriptionsrechunk: Generate chunked OCI images using rpm-ostreebuild-rootfs: Build container root filesystems from manifestsThe build-rootfs command supports:
Key features:
bootc imagectlandbootc image-buildaliasContainer testing shows identical output to the Python version for the
list command and proper error handling for build operations.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com