Community编程与开发github.com

从本地Kits构建变体

使用本地发布的kits构建Bottlerocket变体镜像,用于开发验证。

从本地Kits构建变体 是什么?

这是一个用于Bottlerocket操作系统的开发者技能,允许工程师利用本地发布的kits构建完整的变体镜像。该技能在提交更改到生产注册表之前,提供端到端的测试能力,特别适用于验证kit修改的完整性。它支持在本地开发环境中生成可启动镜像,并且与Bottlerocket变体仓库集成。技能的核心工作流程包括配置本地注册表依赖、选择要从本地获取的kits(通过设置vendor = "local")、更新锁文件、最终使用`cargo make`构建变体。用户可以为特定变体(如aws-k8s-1.31)或架构(如aarch64)进行定制构建。完成后,已构建镜像会生成在`build/images/`目录下。该技能还提供了清理步骤(恢复上游配置)以及常见问题解决方案,例如kit未找到或版本不匹配。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/build-variant-from-local-kits

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

技能:从本地Kits构建变体

目标

使用发布到本地开发注册表的kits,构建一个完整的Bottlerocket变体镜像。这使您能够在将kit更改发布到生产注册表之前,对其进行端到端测试。

何时使用

  • 在完整变体构建中测试kit更改
  • 为本地测试创建可启动镜像
  • 对kit修改进行端到端验证

前提条件

  • Kits已构建并发布到本地注册表(使用 build-kit-locally 技能)
  • 本地注册表正在运行
  • Bottlerocket 变体仓库

操作步骤

1. 配置为使用本地注册表

cd ./bottlerocket
brdev twoliter use-local-deps

这将创建 Twoliter.override,指向本地注册表以获取kits。

2. 选择要从本地获取的kits

编辑 Twoliter.toml,为要从本地注册表获取的kits设置 vendor = "local":

[kit.bottlerocket-core-kit]
vendor = "local"  # 从本地注册表获取
version = "2.0.0"

[kit.bottlerocket-kernel-6.1-kit]
# 无 vendor 覆盖 - 使用上游
version = "2.0.0"

只有设置了 vendor = "local" 的kits会从本地注册表获取;其他kits使用上游。

3. 更新锁文件

./tools/twoliter/twoliter update

4. 构建变体

cargo make

对于特定变体:

cargo make -e BUILDSYS_VARIANT=aws-k8s-1.31

对于特定架构:

cargo make -e BUILDSYS_ARCH=aarch64

5. 定位已构建的镜像

ls -lh build/images/*.img

验证

构建应成功完成,并在 build/images/ 目录下生成一个 .img 文件。

清理

测试完成后,恢复上游配置:

brdev twoliter use-upstream-deps

这会移除 Twoliter.override。 请记得同时还原 Twoliter.toml 中任何 vendor = "local" 的更改。

常见问题

注册表中未找到kit:

Error: failed to pull kit

解决方案:使用 brdev registry list 确认kit已发布。

版本不匹配: 解决方案:确保 Twoliter.toml 中的版本与已发布的kit版本一致。

锁文件不同步: 解决方案:再次运行 ./tools/twoliter/twoliter update。

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-requirements

Create or update feature requirements specification using EARS notation with examples and appendices

propose-feature-test-plan

Create a test plan mapping EARS requirements and Critical Constraints to specific tests

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

review-style

Verify code follows project style guides without providing improvement suggestions

test-local-twoliter

Build and test local changes to twoliter before releasing

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

相关技能