Skip to content

Conversation

@jeckersb
Copy link
Collaborator

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

Co-Authored-By: Claude [email protected]

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 <[email protected]>
@bootc-bot bootc-bot bot requested a review from jmarrero November 21, 2025 22:36
@jeckersb
Copy link
Collaborator Author

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 👋

@cgwalters
Copy link
Collaborator

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:

  • Move into Fedora namespace
  • Create bootc-dev/fedora-base-imagectl

Of course it might not be too hard for this tool to grow package abstractions, and it could become bootc-dev/<bikeshed>-imagectl here. But still though I think a core principle of this project is that we boot OCI images and should support multiple build systems.


That said I think it does make sense to chip away at things from the "bottom"; a wrapper for ukify seems reasonably self contained for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants